The anytime jQuery plugin by default displays with the current date/time. The current date is perfect, but I want to set the time to midnight/00:00:00 for one "DateTimePicker" and the day's ultimate second (23:59:59) for the second one. How to do that?
UPDATE
Interesting - that causes the following to display in the anytime datetimepicker:
Mon, 29 Apr 2013 07:00:00
(actually, I can't see the last zero, but I'm assuming that's what it is).
On clicking on the component (is this the correct terminology for a jQuery plugin component/control instance?), the text reverts to:
2013-04-29 15:39:33 (current local time).
I reckon the 7 am jazz shown first has something to do with the UTC differential between here and...Greenwich, I would guess (I'm in California), but the fact that it reverts to the current local time (instead of remaining at 7 am, which I'm sure could be tweaked to accommodate the hour differential) makes this only entertaining rather than exhale-inducing.
UPDATE 2
I'm awarding a bounty to Marcacci ASAP, but stil, an interesting addendum to all this: Based on that code, I was able to work out what was needed if I just want to get up to the current second (when the page was loaded), rather than up to the second before midnight of the current day, which normally would be quite a few hours in the future:
var d = new Date();
var t = new Time();
var s = ('0' + (t.getHour() + 1)).slice(-2) + ":" +
('0' + (t.getMinute() + 1)).slice(-2) + ":" +
('0' + (t.getSecond() + 1)).slice(-2);
return d.getFullYear() + "-" + ('0' + (d.getMonth() + 1)).slice(-2) + "-" + ('0' + d.getDate()).slice(-2) + s;
However, oddly enough, the text/anytime DateTimePicker is blank when I use this code - until I click on it! Then it populates as I would expect it to...???
The other one (the "Begin Date") component, displays its value (midnight on the first of the month):
var d = new Date();
return d.getFullYear() + "-" + ('0' + (d.getMonth() + 1)).slice(-2) + "-" + "01 00:00:00";
...just fine.