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.
It would be awesome if the end date gets synchronized with the start date. So, when selecting a start date using the pop-up, you don't have to select the same date again for the end date.
Comment | File | Size | Author |
---|---|---|---|
#10 | sync_end_date_for_the-2331975-10.patch | 1.63 KB | StryKaizer |
#3 | interdiff-1-3.txt | 674 bytes | BarisW |
#3 | 2331975-3-sync-end-date-for-date-popup.patch | 1.54 KB | BarisW |
#1 | 2331975-1-sync-end-date-for-date-popup.patch | 1.51 KB | BarisW |
Comments
Comment #1
BarisW CreditAttribution: BarisW commentedHere's a rough patch that adds this functionality.
I now made it configurable in the admin interface by adding an extra option under the date Field Settings > More settings and values > Default values > Default end date.
Comment #3
BarisW CreditAttribution: BarisW commentedComment #4
julou CreditAttribution: julou commentedDo you really need to patch a core module for that?
Can't you rely on a js based solution? e.g. http://tylerfrankenstein.com/code/drupal-automatically-set-date-when-dat...
Comment #5
BarisW CreditAttribution: BarisW commentedThe Date module is not a core module. It's a contrib?
Comment #6
julou CreditAttribution: julou commentedSorry… my mistake.
Comment #9
hannessdoes it already works?
right now i also found http://drupal.stackexchange.com/questions/101835/change-end-date-automat...
Comment #10
StryKaizer#3 did not work with multi-value date fields.
I altered the code to also work with multivalue fields.
This patch requires date >= 2.9
Comment #11
StryKaizerComment #12
eidoscomI tried the last patch with multivalue field and now it works :)
Thanks!
Comment #13
eidoscomComment #14
hcderaad CreditAttribution: hcderaad commentedThe patch from #10 does indeed work with Date Version: 7.x-2.9, thank you!
Is there any planning about when this could be integrated in the contrib Date module?
Comment #15
Peter Arius CreditAttribution: Peter Arius as a volunteer commentedI appreciate this effort, of course, but found that the Smart Dates module is the more convenient solution: Set a default duration for the date field (which will pre-popuplate end date+time), and then Smart Dates will keep end date/time in synch when user changes the start date/time.
Hope that this patch won't interfere with Smart Dates when it will be committed, or that both approaches can be merged.
Comment #16
podarok#10 merged. Thanks.
Comment #19
echoz CreditAttribution: echoz commentedFollowup: #2868046: Have End Date initially blank before it's synced, rather than populated with "now" values
Comment #20
abdolmaleki CreditAttribution: abdolmaleki commentedThis feature does not work when I use datex module as a date picker because This feature depends on the date_popup.js file, and when another module is used as a date picker, this file does not load. How to write a separate JavaScript file for this feature to load on the page anyway?
and how do you think I put this code
in datex.js file to solve my problem?
Comment #21
DamienMcKenna@abdolmaleki: Please open a new issue for this, thank you.