I'd like to use scheduler but in stead of using:
'Y-m-d H:i:s' date format, I'd like to use 'd-m-Y H:i:s' or 'd-m-Y'
It is that possible?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | scheduler-module-254212-7.patch | 7.81 KB | eric-alexander schaefer |
I'd like to use scheduler but in stead of using:
'Y-m-d H:i:s' date format, I'd like to use 'd-m-Y H:i:s' or 'd-m-Y'
It is that possible?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | scheduler-module-254212-7.patch | 7.81 KB | eric-alexander schaefer |
Comments
Comment #1
eric-alexander schaefer commentedI am sorry, but currently you have to use 'Y-m-d H:i:s'.
But scheduler really should support different date formats.
Comment #2
eric-alexander schaefer commentedTo support different date formats we need a better strtotime().
I don't like any means of input which must follow a certain format. Maybe a better way to input dates and times would be a separate input control for each format entity (e.g. a seperate input control for day, month, year, hour, minute and second). This prevents the user from inputting a wrong format instead of whining afterwards. The input controls can even be dropdowns or lists with all availlable numbers, like 1-12 for the month. The downside of this approach is the incompatibility with ajax calendar controls.
Opinions?
Comment #3
skiminki commentedI agree that we need better strtotime(), but I'm afraid that then we'd need to parse datetime input strings ourselves and use gmmktime() (or similar) to build the timestamp. But that's not necessarily a bad thing? Because then we could use a drop-down list to select the format - and that should be pretty unambiguous. We could even save the format (per user) so that it'll be pre-selected the next time the user gets to select publish/unpublish datetimes. End of whining.
However, I really don't like the idea of using drop-down lists to select year/month/day/etc. It's not usable. If the user needs visual widget to enter datetime, better let the user use jscalendar.
Comment #4
eric-alexander schaefer commentedYeah, six widgets for input of a time is probably a bit excessive ;-)
Comment #5
eric-alexander schaefer commentedFor your pleasure and entertainment (don't laugh too hard).
Please review and test this thoroughly, since it might break scheduler if it is flawed. We need to be careful with this change anyways.
Meanwhile I will integrate the function into scheduler.module and provide means of configuration for the date format.
Comment #6
eric-alexander schaefer commentedGo ahead and shoot me. The above is uses strftime() date format but we need date() format options otherwise we end up creating our own format_date() function. Here you go:
Comment #7
eric-alexander schaefer commentedThe attached patch is diff'ed against the current CVS version of scheduler.module (1.46.4.31).
Did you know jscalendar 24-hour mode did not work with scheduler? I fixed it because I had to extend the jscalendar parameters for user defined date format anyways. 12/24-hour mode is now selected by looking at the date format.
Comment #8
eric-alexander schaefer commentedhttp://drupal.org/cvs?commit=117967
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.