HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Calendar date and time being changed for historical events

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#71264 (In Topic #15027)
Avatar

Community saint

I have entered a "Date and Time" of 1/1/1924 12:00am which upon save gets changed to 4pm.

Further, when entering the "End date and time", I have used the "—" entry which is getting changed to a 5pm (one hour) entry. The caption for this field states "If this event is one that has a length, rather than just a point in time, choose an end date and time for it." which certainly suggests that you are not forced to have an end date (i.e., it is an all-day event). In fact, as I noted elsewhere, you should be able to enter "—" for the start time for an all-day event.

Bob
Back to the top
 
Posted
Rating:
#71265
Avatar

Community saint

The above problem is worse than stated. I edited an entry I made from 9/19/1909 12:00am to 9/19/1909 11:59pm. After saving, the start date is 9/19/1909 7:00am and the end date is 9/20/1909 6:59am.

The software is clearly not respecting what is entered and is doing it's own thing determining the length of events.

Bob
Back to the top
 
Posted
Rating:
#71282
Avatar

I'm not sure there is a bug here, I just did some testing. The times are entered with timezones. So if BillyBob enters it at 7am it will get converted to GMT in the database, but when they view or edit it it will still say 7am. It might say 10am for JoeyBob in a different timezone.
I am pretty aware that is not always what you want (there's an item on the tracker about making this more flexible) – it makes sense for some use cases, not for others.

Regarding '—', they are supposed to be all '—' or none, I think the code probably invents some meaning for if a mixture is used but it's not a feature. The calendar system certainly doesn't have any way of storing partial dates/times.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71285
Avatar

Community saint

In the case of the end date, they were all "—" and a new date (the next day) was assigned 25 hours in the future (not accounting for minutes).

In fact, as I recall, they won't accept "—" for the time if a date is entered. I think such an entry should be valid as stating "some date, all day)".

Bob
Back to the top
 
Posted
Rating:
#71288
Avatar

Oh, to my surprise I see now -- blanking out the end date does not save. Looking into it now...


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71289
Avatar

Attachment
cms/pages/modules/cms_calendar.php
» Download: cms_calendar.php (44 Kb, 102 downloads so far)
Attachment
sources/calendar.php
» Download: calendar.php (19 Kb, 94 downloads so far)


Okay, so I could see that glitch - when going in to edit it did love to try and make you have an end date by resetting it to one hour after the start date if it was not yet set, which was a bug.

Also I did your 23h59m event scenario, and it worked, but it looked ugly (displayed in minutes). That's because it was not actually 24h. But we have nicer time period code than this, so I have hooked it into that and now it looks decent.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71300
Avatar

Community saint

It's somewhat better in terms of display but the conversion to/from UTC seems not to be roundtrip.

For example, I save an even starting at 12:00am on 9/19/1909. When I go back to edit this event, the starting time is 9/19/1909 7:00am (UTC of original time) rather than local time. If I save this with the 7am time, the next time I edit it, the starting time will be 2pm (another 7 hours added to the last saved time).

Further, in the "Edit event" list, the date and time does not match the time on the event - in this case, event starting time is 9/19/1909 7:00am but the event list show 9/18/1909 5:00pm.

Bob


Last edit: by BobS
Back to the top
 
Posted
Rating:
#71305
Avatar

Hmm, maybe I have fixed it inadvertently with other timezone changes made recently. Bring this back up if it is still in 7.1.1 please, because I couldn't reproduce.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71306
Avatar

Community saint

Will do.

Bob
Back to the top
 
Posted
Rating:
#71469
Avatar

Community saint

Chris-

The above are still issues in 7.1.1.

  • 1) The time is not round-tripped to/from UTC. When I enter 12am for local time, it is being stored correctly as 7am UTC (except for the one-hour timezone discrepancy). However, if I choose to edit the event, the starting time shows as 7am (rather than 12am if round-tripped).
  • 2) If I make a change in say the notes section without changing the starting time back to 12am, the entry is saved with a 2pm (+7 hour) starting time. The start time will continually advance because the starting time is not converted back to local time.
  • 3) there is a disconnect between the time shown on the "Edit event" (e.g, 12am) and the starting time on the actual event. See attachments:


Hope that points you in the right direction.

Bob
Back to the top
 
Posted
Rating:
#71551
Avatar

I still can't reproduce the main issue here, but I could see the issue on the choose-to-edit calendar listings.
A fix is attached.

Could you try this, and tell me if the roundtrip issue is still there. From my perspective it seems possible the incorrect time shown on the choose-to-edit screen may have led to confusion and be the only actual bug.

Attachment
cms/pages/modules/cms_calendar.php
» Download: cms_calendar.php (44 Kb, 100 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71552
Avatar

Community saint

Chris-

I'll try this later today after I am fully-caffeinated.

Bob
Back to the top
 
Posted
Rating:
#71561
Avatar

Community saint

Chris-

Your patch has fixed the choose-to-edit list:


But the Event Entry is still not round-tripped (shows 7am):


When I try editing the above entry by entering 12am as the start time, it always changes to 7am upon saving.

And then there is the Calendar Entry detail which appears round-tripped but with a one-hour difference in timezone when compared to the choose-to-edit list:


My timezone is UTC-8.

Bob
Back to the top
 
Posted
Rating:
#71579
Avatar

Got it.

It only happens with dates before 1970, because unix timestamps are negative and ocPortal is a bit cautious (inconsistently so).

The attached files should fix it.

Attachment
sources/temporal2.php
» Download: temporal2.php (2 Kb, 110 downloads so far)
Attachment
sources/form_templates.php
» Download: form_templates.php (66 Kb, 103 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71581
Avatar

Community saint

Chris-

Some progress but still not right.

The Edit entry start time no longer changes but an end time is saved even after specifying "—" for the end time.


The calendar detail is also still off (1 hour early).


Bob
Back to the top
 
Posted
Rating:
#71589
Avatar

Attachment
sources/global2.php
» Download: global2.php (74 Kb, 98 downloads so far)
Attachment
sources/form_templates.php
» Download: form_templates.php (66 Kb, 108 downloads so far)


End-date issue should definitely be fixed with this.

I cannot reproduce the one-hour issue, but I have a speculative fix. I've changed ocPortal's internal timezone to UST instead of London, because I think something about your PHP environment may be adding DST (although it isn't on mine).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#71592
Avatar

Community saint

Looking good, Chris!   :thumbs:

Thanks for your perseverance.

Bob
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: