Date Time Picker customization

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2012 07:35 AM
From a request we had by the process owners of change, we developed a onLoad client script to set the DateTime picker to default to zeros on the time entry so when the icon is clicked, the time is defaulted to 00:00:00 in the popup.
Here is our current code
function onLoad() { setDatePickerTime('start_date'); setDatePickerTime('end_date'); setDatePickerTime('requested_by_date'); setDatePickerTime('work_start'); setDatePickerTime('work_end'); function setDatePickerTime(field){ //Attach an event listener to set default time value for date picker Event.observe(g_form.getControl(field).next('a'), 'click', function() { $('GwtDateTimePicker_hh').value = '00'; $('GwtDateTimePicker_mm').value = '00'; $('GwtDateTimePicker_ss').value = '00'; }); } }
Works fine in Aspen, but not in Berlin. We are getting java errors in IE and although we do not get errors in Chrome/Firefox, it does not change the time entries to zeros.
Does anyone have any ideas what changes I might make to allow this to work again in Berlin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2013 10:05 AM
$('GwtDateTimePicker_ampm').value = 'am'
or
$('GwtDateTimePicker_ampm').value = 'pm'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2015 03:41 AM
This has been working OK pre Fuji but on fuji I get an error - any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2015 08:32 AM
Hey Ruth,
Did you end up finding a solution for this?
Thanks,
Tony

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2015 03:34 PM
I've been using the SNGuru solution since Berlin and it has been working great until Fuji. I just found that I needed to make two simple changes to get it working again. Remove the 'a' from the next() and then set the timeout to 300. Event.observe($(g_form.getControl(field).id).next(), 'click', function() { setTimeout("$('GwtDateTimePicker_hh').value = '00';$('GwtDateTimePicker_mm').value = '00';$('GwtDateTimePicker_ss').value = '00';",300); });
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2015 10:07 AM
Hi Shannon,
It is still not working in Fuji for me.
could you plesae help me with it ?