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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC