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.
I've created content type with date field. It's 'day' granularity, default 'now', optional 'to' date.
Whether or not I've created a 'to' date, if I open the content to edit it, it has created a further pair of from and to dates set as today. If I save like this it will create another pair when I open again.
Comments
Comment #1
Moonshine CreditAttribution: Moonshine commentedSounds like you might have the field set to accept multiple values and have defaults set that prepopulate them? I think some more information will be needed...
Comment #2
Tony Sharpe CreditAttribution: Tony Sharpe commentedThe field is set to multiple values - it has to be for this application, as does the 'optional' 'to' date. I've changed the default to none rather than now which is OK for me. What happens now is that the 'from' date remains blank but the 'to' date is pre-populated with today and so will have to be cleared if I want a single day event (set to a future date) otherwise it will cause an error. When I save and re-open another date field pair has been created and the 'to' date is again pre-populated but not the 'from' date. If I leave it like this and save it then it seems to work and doesn't create a 2nd event slot (there's no 'from' date) and doesn't add any further fields when I re-open but it seems confusing like this and would be better if the 'to' date wasn't pre-populating.
Comment #3
KarenS CreditAttribution: KarenS commentedIt sounds like you have the default value for the 'to' date set to 'now'. Edit your field settings and change the default value for the 'To' date to blank. Some settings are in collapsed field sets, so open them up to see all the options.
Comment #4
Tony Sharpe CreditAttribution: Tony Sharpe commentedAh, Found it! I guess I wasn't realising that 'customise default value' would have 'to' date settings in it when 'To' date settings were set further down the page.
Thanks
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.