I want to set default time in this datetimepicker as 00:01 for the current date. Anyone tried that before? Having a tough time with it. It Seems simple.
$('#startdatetime-from').datetimepicker({
language: 'en',
format: 'yyyy-MM-dd hh:mm'
});
I need to use setDate
, but I'm not sure how. I checked their code, but did not find a parameter for that.
i tried to set default time for a picker and it worked:
this will save in database as : 2015-03-01 12:00:00
used for
smalldatetime
type in sql serverThis is my solution for your problem :
This also work for setting a default hour or both. Note that this code sample works with the
useCurrent: false
parameter too.When the user pick a date, we check if the minute is 0 (hard-coded default value). In this case, we set a 1. Then, the user cannot select 0.
I solved my problem like this
For use datetime from input value, just set option useCurrent to false, and set in value the date
It works for me:
use this after initialisation