[Not sure if this will append to existing Topic dhtmlxCalendarand time?]
Problem with dhtmlxCalendar + time
1. Calendar header displays 2009 as 1909 ie May,1909 - see below
2. Time is always 12:00:00
1. On start with blank boxes, left click in box brings up calendar with
a) current date eg
b) time = 12:00:00 always this ie not current time : how to fix this?
2. Select current date and boxes populated
05/16/09
12/00/00
3. left click in box brings up calendar with
a) date = 16 May,1909 not 2009!
b) time = 12:00:00
4. Select the given date/time and boxes populated correctly
05/16/09
12/00/00
ie its only calendar display header and the time thats a problem
Hello,
We forgot to set the date format in the provided sample.
Try to include the following line, possibly it will resolve the problem:
cal.setDateFormat("%m/%d/%y");
Thanks I did manage to work the setDateFormat call after I posted.
I am also trying to pre-populated the date+time boxes with the
current date+time.
Problem is that when you click on a date/time box for the first time
the calendar pops up with
1) the correct date ie todays
2) the incorrect time ie 12:00:00 and not current time.
The correct time is picked up but only after a date/time is first selected on the calender.
You can try to call setTime(val) method as follows:
…
cal.enableTime (true);
cal.tp.setTime(new Date());
.
Thanks thats brilliant, it works a treat.
I also added: tp.setTime(new Date()); into dhtmlxcalendar.js
under < if (this.options.headerButtons.indexOf(‘T’)>=0) >
so when the T today button is clicked it updates both date and time.
Yes,
this is a great solution. Thank you for it. We’ll include it into the next release.