Skip to content

Added new DateRangeFieldOutputHandler

gngn requested to merge gngn/dataprocessor:main into main

This adds two new FieldOutputHandlers both about date ranges.

Both extend DateFieldOutputHandler and can be used for field types 'Timestamp' and 'Date'.

DateRangeFieldOutputHandler: show start and end date together like 'September 16, 2024 - September 18, 2024' Additional configuration:

  • End date: another timestamp or date field used as "end date"
  • Separator: string to separate the start and end date
  • Format date only: optional format to use if time is not set (i.e. has default time 00:00:00). This one is useful for many of our customers who do not enter a time (getting internal default time) and do not want the "00:00" to show up in their event list (but do want the time shown if it is set).

Output examples:

  • "25.04.2024 12:00 - 25.04.2024 17:00"
  • "Wednesday, 17. July 2024 - Friday, 26. July 2024" (with format date only)

DateRangeEndMidnightFieldOutputHandler: adjust time part of end date to '00:00' for all day events Events starting at 00:00 and ending at 23:59 are considered "all day events". Additional configuration:

  • Start date: another timestamp or date field used as "start date" (because this one only shows the date for end date we use end date as the "main" field and start date as the additional field).
  • Time format

Output logic: If start date has default time 00:00 and end has time 23:59 -> format date and time using 00:00 as the time part. Otherwise simply format the end date with date and time.

Output examples:

  • "Thu, 09 Aug 2024 00:00" (with start date 2024-08-08 00:00:00 and end date 2024-08-09 23:59:00)
  • "Thu, 09 Aug 2024 18:30" (with start date 2024-08-08 12:00:00 and end date 2024-08-09 18:30:00)

What can this filter be used for? Imagine an event lasting for two or more days without a time specification, and you want to provide it as an ics feed: When using the 24-hour time format, 00:00 has to be specified as the time for the start day and 23:59 as the time for the end day. In this case however, if you want to output your events as a list using DataProcessor, the confusing specification of 23:59 should be omitted.

Merge request reports