2

I'm trying to make an events calendar that has events on a day, (e.g. Feb 2), with a start and end time, (1pm - 3pm).

However, the current date module in Drupal 8 doesn't have support for end times and the date module doesn't seem to be ready yet.

How would I such a date field up? I could always use a textbox, but I need to be able to set different date formats for the day of this field.

I see that there isn't a well known option for drupal 7, but hopefully there is a elegant solution for Drupal 8. Worst comes to worst, I'll accept hacky solutions....

Thanks!

3

You need to enable the Datetime Range module. It is currently an experimental module in Drupal 8, and not enabled by default. On admin/modules it's in the Experimental group:

enter image description here

Enable it, and a new field type will appear, Date Range.

6
  • Thanks! Now I just got to figure out how to format the way the date fields is setup and remove the seconds part of the time.... Thanks again! Jan 29 '17 at 22:42
  • @ChrisHappy Just use the custom formatter and read the docs for how to build the format string.
    – mpdonadio
    Jan 29 '17 at 22:43
  • @ChrisHappy No, on Manage Display for the field, there should be a standard formatted named Custom Format (or similar).
    – mpdonadio
    Jan 29 '17 at 22:47
  • 1
    This option enable start date and end date with times, whearas the questions is to have time range on same date. Formatter does have option to list only start or end date So basically with this solution the output is start date , time - end date, time instead of date - start time, end time
    – Ekta Puri
    Nov 25 '19 at 1:05
  • Yes as @EktaPuri says this answer doesn't provide exactly what the original post (and myself!) is looking for: One date field, a start time, and an end time. Is there anything that does?
    – mlncn
    Mar 31 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.