We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Date field displaying different on entry preview pane

Development and Programming

msunickb's avatar
msunickb
19 posts
4 years ago
msunickb's avatar msunickb

I’ve built a site for a local funeral home that is entering a start date/time for individual services. I wrote a small plugin that allows them to select the duration then outputs the end time rather than having two date/time fields for them to enter. When they enter the start time and save it displays both in the CP and the website correctly. However, if they view the entry within preview, the dates are both off an hour. This is the same for all entries…not just the ones using the plugin to output an end time.

The forum won’t let me up upload files for some reason so here are links to the three screenshots:

Live Website

Entry in CP

Entry Preview in CP

You can see the date/time shows correctly in the first two but in the last (cp preview) it’s displaying an hour off.

Thank you!

       
Tom Jaeger's avatar
Tom Jaeger
228 posts
4 years ago
Tom Jaeger's avatar Tom Jaeger

Thanks for passing this along.

After taking a quick peek at it, I’d be inclined to say it’s related to the users time zone and daylight savings setting in the Control Panel. I’d recommend checking that to confirm they are set correctly.

I also just wanted to ask in passing if you took a peek at the Duration Fieldtype?

https://docs.expressionengine.com/latest/fieldtypes/duration.html

       
msunickb's avatar
msunickb
19 posts
4 years ago
msunickb's avatar msunickb

Hey Tom, thanks for your response! The date issue happens for all users, including mine however I do think you may be right. When I change my account timezone is currently set to America/Detroit, which is the same as the site…but when I preview it now shows the time as 5 hours off. It should be 2-4 on the sample I’m looking at but it’s displaying as 7-9 when I view in preview.

I have not used duration and didn’t realize it existed! I will test this and see how it works! Thank you for the suggestion!

Nick

       
msunickb's avatar
msunickb
19 posts
4 years ago
msunickb's avatar msunickb

I don’t believe the duration field would work in my case as they wanted to display the end time of the event but not have to populate to date/time fields to do it. That is awesome to know that’s there though, thank you!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.