php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78235 User Group Event form day-of-week field off-by-one error
Submitted: 2019-06-30 14:57 UTC Modified: 2019-06-30 16:00 UTC
From: rowan dot collins at gmail dot com Assigned:
Status: Verified Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
39 + 19 = ?
Subscribe to this entry?

 
 [2019-06-30 14:57 UTC] rowan dot collins at gmail dot com
Description:
------------
I am attempting to create a listing for a recurring User Group event at https://www.php.net/submit-event.php

When I select "First Wednesday of the month" on the form and click "Preview", it displays "First Tuesday of the month" in the preview. To get "First Wednesday", I have to select "Thursday" from the drop-down. In other words, the day displayed in the preview is a day before what's displayed on the form.

I note that the list is shown Monday-first; perhaps there is a mismatch with a system expecting Sunday-first ordering. In case it's relevant, my browser is set to Europe/London timezone and en-GB locale.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-30 16:00 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2019-06-30 16:00 UTC] cmb@php.net
> I note that the list is shown Monday-first; […]

That depends on the current year, since the list is generated from
the first seven days of April[1].  The preview seems to use the
submitted month instead[2], what would explain the reported
behavior for September.  Apparently, after actual form submission
the day is calculated for April 2001[3] which likely yields yet
another result.

[1] <https://github.com/php/web-php/blob/master/submit-event.php#L161-L163>
[2] <https://github.com/php/web-php/blob/bf67b086c586a3eaa71b12166062e6e6762ac45b/include/layout.inc#L342>
[3] <https://github.com/php/web-master/blob/2d9f549e01adbc625396daf2fa7c2ec00fd067c4/entry/event.php#L17-L19>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 24 08:01:27 2019 UTC