Event Date Field For Export vs Display

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
1 year 9 months ago #156777 by David Unwin
Event Date Field For Export vs Display was created by David Unwin
In the configuration for Events Booking you can set a date format for the Event Date Field.  We have ours set to 'l, jS F, Y  g:i a' This produces nice looking dates for our users ie Monday 1st January, 2023 10am.

However, Setting the Event Date Field to 'l, jS F, Y  g:i a' or leaving blank (default) creates a problem when you want export and analyse your registration records say using EXCEL as the date fields are all exported as TEXT fields and you cannot do computations against these date fields ie Extract the Month or Day or hour from the Event Date Field
You can resolve this by setting  the Event Date Field format to Y-m-d H:i:s. Then the date fields are exported in a format that you can do computations against the Date Fields.
However, If we  set the Event Date format field to Y-m-d H:i:s it shows on our events with a US Format ie 2023-01-01 10:00:00 which is US format, we are in the UK. It also does not look nice. see attached screen shot
What is required is an extra config field where you can set the Event Date Field for Export to Y-m-d H:i:s for export purposes and leave the Events Date format to  display events as default or the user's set value
Would this be hard to do?
Kind regards
David
Attachments:

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #156782 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Event Date Field For Export vs Display
Hi David

It's not hard but it is a special requirement. I will leave this request here. If there are more customers need it, I will consider supporting it in the future

Regards,

Tuan
The following user(s) said Thank You: David Unwin

Please Log in or Create an account to join the conversation.

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
1 year 9 months ago #156786 by David Unwin
Replied by David Unwin on topic Event Date Field For Export vs Display
Thanks Tuan,
I will add it to Features request list, so that other people can comment if they would like it

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago - 10 months 2 weeks ago #164251 by Martijn Hartong
Replied by Martijn Hartong on topic Event Date Field For Export vs Display
Yes please, the registrants export (templates) needs an option for UTC Format like: 'Y-m-d H:i:s' or 'YYYY-MM-DDThh:mm:ss' to work well with other applications.
For the events I got it working with an admin override, but registrants fields seems to be different or is there an option to override export templates? Of course the site date format remains for human readability.

Thanks
Last edit: 10 months 2 weeks ago by Martijn Hartong.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #164356 by Martijn Hartong
Replied by Martijn Hartong on topic Event Date Field For Export vs Display
For now I managed to override the public export function of the admin Registrant controller with the following addition before model:
// Set UTC date format
        if (Factory::getApplication()->isClient('administrator'))
        {
            $config->set('event_date_format',  'Y-m-d H:i:s');
        }

Please Log in or Create an account to join the conversation.