1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Date element save 12 o'clock PM as 12 Am

Discussion in 'Community' started by mahmoodee, Nov 28, 2019.

  1. mahmoodee

    mahmoodee Member

    Level: Community
    Hello,
    I have this problem in date element
    When I select 12:00:00 PM or 12:00:00 AM from time selector , It show as 12 AM in list .
    So If I select like this date 2019-12-03 and select this time 12:00:00 PM and save the form , it show this date in list
    2019-12-03 12:00 AM
    If I edit the form , it show AM too .
    Why the date element save 12 PM as 12 Am ?
    Why the date element save the 12 PM in database as 21:00:00 instead of 9:00:00 ?
    I am using date element with this settings:
    Show time selector: Yes
    Picker : Number
    24 Hour : No
    List format : Y-m-d h:i A
    Form format : Y-m-d
    thank you
     
  2. sunnyjey

    sunnyjey Active Member

    Level: Community
    Yes, I am too facing same issue since last few months on default date element (not sure but since jdate plugin addition).

    In my case date gets change to some random future date, when F! form is submitted between 12:00:00 to 12:59:00.

    Before using Time picker, there is space between time value & PM:
    Screen Shot 2019-11-29 at 2.01.26 pm.png

    But after changing the Time with the help of Time Picker, the space disappears. I dont know this is related to my server or universal. Not sure whether this is causing above issue.

    Screen Shot 2019-11-29 at 2.01.54 pm.png
     
  3. troester

    troester Well-Known Member Staff Member

    Level: Community
    I can confirm:
    Selecting 12:xx PM with the time picker (numbers) is storing 12AM-time in the database (and showing it "correctly" (related to what is in the DB) in list, details, form view. This is only for 12, with any other hour it's ok.

    The clock time selector is also mixing up AM and PM.

    But there's such a nice, unambigious 24h format;) (I never understand which of 12PM or 12 AM is midnight or noon and where is the logic)
     
  4. sunnyjey

    sunnyjey Active Member

    Level: Community
    @cheesegrits

    In case if you get a time, please have look on this issue.
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'll take a look. Like Troester, I never use AM/PM, I always use 24h, as a lot of people (myself included) get confused about whether 12:00 AM is noon or midnight.

    -- hugh
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    OK, well it appears I'm not the only one confused by 12am vs 12pm. 12pm is usually understood to be noon. But 12am can refer to either midnight at the start of a day, or midnight at the end of the day:

    https://www.npl.co.uk/resources/q-a/is-midnight-12am-or-12pm

    So I'm going to have to make an executive decision, and say that 12am is the start of the day.

    However ... I strongly suggest that everyone just updates all their date elements to jdate, as we'll be deprecating the 'date' element soon. Joomla no longer supports nor ships the date library the original date element used.

    -- hugh
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    sunnyjey likes this.
  8. sunnyjey

    sunnyjey Active Member

    Level: Community
    I have tried with fresh Github Update, but looks this fix is not working, at least on my server ! (I wanted to confirm this issue, that's why I took longer time to reply).

    When the form is submitted between 12PM to 1PM (12 to 13hrs) and when you edit and save the same form, the hours get shifted by 12 hours, thus changing date to next day.
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Oh well, I tried. Have you tried the jdate element?

    -- hugh
     

Share This Page