Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi all,
I noticed that the module uses american date format for date input. Is it possible to change the input format to the system "short date format"??
Where to change format in code?
Comment | File | Size | Author |
---|---|---|---|
#4 | workbench_scheduler-date-format-2693387-4.patch | 4.85 KB | partdigital |
#3 | workbench_scheduler-date-format-2693387-3.patch | 2.79 KB | Eric_A |
Comments
Comment #2
Eric_A CreditAttribution: Eric_A commentedI extracted 2.x code by mairi out of the monster patch in #2680567: Miscellaneous features and minor bug fixes and backported it to 7.x-1.x.
It introduces a workbench_scheduler_date_format variable that can be set with drush or devel and controlled with a feature. No UI in this patch.
Comment #3
Eric_A CreditAttribution: Eric_A commentedAdded an implementation of hook_uninstall().
Comment #4
partdigital CreditAttribution: partdigital commentedHi Eric_A, thanks for your help on this. I grabbed your patch and took it one step further. Instead of using a variable I used the internal Drupal date format 'short'. This also accounts for locale. In a later commit we can add a settings page where admins can change the date format to 'medium', 'long' or any other custom date format.
I also replaced 'Y-m-d H:i:s' with the DATE_FORMAT_DATETIME constant.
Note: This is for version 7.x-2.x
Comment #5
partdigital CreditAttribution: partdigital commentedComment #6
mairi CreditAttribution: mairi commentedThanks so much @Eric_A @partdigital - this community really is awesome :) I have finally managed to come back to this & I need to take the latest 7.x-2.x-dev & apply the patches I had started splitting down. I'll try this one in place of what I have for date format, and will review #2717419-5 as well. I'll create issues for the remaining parts. Sorry it's taken so long!
Comment #7
mairi CreditAttribution: mairi commented@Eric_A @partdigital I have applied the patch from #4 locally and it is looking good. +1 for not needing the additional variable setting and -1 to me for not thinking the Drupal date format 'short' in the original patch :)
Comment #9
partdigital CreditAttribution: partdigital commentedThis has been rolled into the latest dev release. Thanks for your help everyone!