Setting the calendar value using viewDate function in Tempus Dominus












1















What I am trying to do is set the month and year from an event calendar to Tempus Dominus datepicker. So on the main page is a big calendar, the user may change the month from November to December, and the create a new event in December.



Once the user clicks the button to enter a new event, I want to set the datepicker to that month. Per the docs on the page I access the functions with:



$('#datetimepicker').datetimepicker(FUNCTION)


To set the viewDate I need to put the date in () viewDate('11/21/2018')
putting it together (I have tried a few different ways it should look something like:



$('#datetimepicker').datetimepicker(viewDate('11/21/2018'))


I have put viewDate in single quotes, tried viewDate: and a few others, with no luck. I currently have it wired to a button and hard coded the date like above for testing.



What is it that I am not understanding or doing wrong.










share|improve this question





























    1















    What I am trying to do is set the month and year from an event calendar to Tempus Dominus datepicker. So on the main page is a big calendar, the user may change the month from November to December, and the create a new event in December.



    Once the user clicks the button to enter a new event, I want to set the datepicker to that month. Per the docs on the page I access the functions with:



    $('#datetimepicker').datetimepicker(FUNCTION)


    To set the viewDate I need to put the date in () viewDate('11/21/2018')
    putting it together (I have tried a few different ways it should look something like:



    $('#datetimepicker').datetimepicker(viewDate('11/21/2018'))


    I have put viewDate in single quotes, tried viewDate: and a few others, with no luck. I currently have it wired to a button and hard coded the date like above for testing.



    What is it that I am not understanding or doing wrong.










    share|improve this question



























      1












      1








      1








      What I am trying to do is set the month and year from an event calendar to Tempus Dominus datepicker. So on the main page is a big calendar, the user may change the month from November to December, and the create a new event in December.



      Once the user clicks the button to enter a new event, I want to set the datepicker to that month. Per the docs on the page I access the functions with:



      $('#datetimepicker').datetimepicker(FUNCTION)


      To set the viewDate I need to put the date in () viewDate('11/21/2018')
      putting it together (I have tried a few different ways it should look something like:



      $('#datetimepicker').datetimepicker(viewDate('11/21/2018'))


      I have put viewDate in single quotes, tried viewDate: and a few others, with no luck. I currently have it wired to a button and hard coded the date like above for testing.



      What is it that I am not understanding or doing wrong.










      share|improve this question
















      What I am trying to do is set the month and year from an event calendar to Tempus Dominus datepicker. So on the main page is a big calendar, the user may change the month from November to December, and the create a new event in December.



      Once the user clicks the button to enter a new event, I want to set the datepicker to that month. Per the docs on the page I access the functions with:



      $('#datetimepicker').datetimepicker(FUNCTION)


      To set the viewDate I need to put the date in () viewDate('11/21/2018')
      putting it together (I have tried a few different ways it should look something like:



      $('#datetimepicker').datetimepicker(viewDate('11/21/2018'))


      I have put viewDate in single quotes, tried viewDate: and a few others, with no luck. I currently have it wired to a button and hard coded the date like above for testing.



      What is it that I am not understanding or doing wrong.







      jquery datetimepicker tempus-dominus-datetimepicker






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 '18 at 23:35









      VincenzoC

      15.9k83857




      15.9k83857










      asked Nov 21 '18 at 22:53









      MaxThrustMaxThrust

      276




      276
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I think that the right way of calling viewDate function is:



          $('#datetimepicker').datetimepicker('viewDate', <value>)


          where <value> is a string (compliant with format option), moment or Date value.



          Anyway, I fear that the current version (5.1.2) of Tempus Dominus datetimepicker has a bug/issue and the viewDate is not notified to the component view.



          If you need you can use date instead of viewDate to change component's value.



          Here a live sample:






          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>








          share|improve this answer
























          • The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

            – MaxThrust
            Nov 26 '18 at 16:55











          • I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

            – VincenzoC
            Nov 27 '18 at 8:25











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421566%2fsetting-the-calendar-value-using-viewdate-function-in-tempus-dominus%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I think that the right way of calling viewDate function is:



          $('#datetimepicker').datetimepicker('viewDate', <value>)


          where <value> is a string (compliant with format option), moment or Date value.



          Anyway, I fear that the current version (5.1.2) of Tempus Dominus datetimepicker has a bug/issue and the viewDate is not notified to the component view.



          If you need you can use date instead of viewDate to change component's value.



          Here a live sample:






          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>








          share|improve this answer
























          • The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

            – MaxThrust
            Nov 26 '18 at 16:55











          • I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

            – VincenzoC
            Nov 27 '18 at 8:25
















          0














          I think that the right way of calling viewDate function is:



          $('#datetimepicker').datetimepicker('viewDate', <value>)


          where <value> is a string (compliant with format option), moment or Date value.



          Anyway, I fear that the current version (5.1.2) of Tempus Dominus datetimepicker has a bug/issue and the viewDate is not notified to the component view.



          If you need you can use date instead of viewDate to change component's value.



          Here a live sample:






          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>








          share|improve this answer
























          • The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

            – MaxThrust
            Nov 26 '18 at 16:55











          • I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

            – VincenzoC
            Nov 27 '18 at 8:25














          0












          0








          0







          I think that the right way of calling viewDate function is:



          $('#datetimepicker').datetimepicker('viewDate', <value>)


          where <value> is a string (compliant with format option), moment or Date value.



          Anyway, I fear that the current version (5.1.2) of Tempus Dominus datetimepicker has a bug/issue and the viewDate is not notified to the component view.



          If you need you can use date instead of viewDate to change component's value.



          Here a live sample:






          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>








          share|improve this answer













          I think that the right way of calling viewDate function is:



          $('#datetimepicker').datetimepicker('viewDate', <value>)


          where <value> is a string (compliant with format option), moment or Date value.



          Anyway, I fear that the current version (5.1.2) of Tempus Dominus datetimepicker has a bug/issue and the viewDate is not notified to the component view.



          If you need you can use date instead of viewDate to change component's value.



          Here a live sample:






          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>








          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>





          $('#datetimepicker1').datetimepicker();

          $('#btnViewDate').click(function() {
          $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          $('#btnDate').click(function() {
          $('#datetimepicker1').datetimepicker('date', moment('11/21/2018', 'MM/DD/YYYY') );
          });

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
          <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/css/tempusdominus-bootstrap-4.css"/>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>

          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
          <script src="https://cdn.jsdelivr.net/npm/tempusdominus-bootstrap-4@5.1.2/build/js/tempusdominus-bootstrap-4.js"></script>

          <div class="container">
          <div class="row form-inline">
          <div class="col-sm-6">
          <div class="form-group">
          <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
          <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" />
          <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
          </div>
          </div>
          </div>
          </div>

          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnViewDate">
          Set viewDate
          </button>
          </div>
          <div class="col-sm-2">
          <button type="button" class="btn btn-primary" id="btnDate">
          Set date
          </button>
          </div>

          </div>
          </div>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 '18 at 23:33









          VincenzoCVincenzoC

          15.9k83857




          15.9k83857













          • The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

            – MaxThrust
            Nov 26 '18 at 16:55











          • I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

            – VincenzoC
            Nov 27 '18 at 8:25



















          • The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

            – MaxThrust
            Nov 26 '18 at 16:55











          • I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

            – VincenzoC
            Nov 27 '18 at 8:25

















          The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

          – MaxThrust
          Nov 26 '18 at 16:55





          The viewdate issue is in the older versions to, going back to 5.0.1 Alpha, if I go older then i need to switch to BS3 from BS4, and a bit too deep to do that. I have tried to create the picker on the fly, and set default to what I need no luck. Also tried it through destroy with no luck. Just need to find time to finish my picker.

          – MaxThrust
          Nov 26 '18 at 16:55













          I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

          – VincenzoC
          Nov 27 '18 at 8:25





          I agree with you, going back to bootstrap 3 it's too much. I've opened this issue on github to keep track of the problem, hopefully the mantainer of the library will fix it.

          – VincenzoC
          Nov 27 '18 at 8:25




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421566%2fsetting-the-calendar-value-using-viewdate-function-in-tempus-dominus%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()