Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix date/time attributes input processing (#719)
Date/time attributes processing was inconsistent in that output of such attributes was done using date() function and a configurable format string, but input was done using strtotime() and no format string. For some format strings this lead to parts (year/month/day) of the date swapped around on each form submit or the update declined. This change addresses the problem through switching to strftime() for output and strptime() for input. This implies a different format string syntax, but both functions are available in early releases of PHP5, as opposed to DateTime::createFromFormat(), which uses the same format as date() but requires PHP 5.3. * datetimestrFromTimestamp(): new helper function * renderEditObjectForm(): update to use above * formatAttributeValue(): idem * renderExpirations(): idem * timestampFromDatetimestr(): new helper function * assertDateArg(): rewrite using above * updateObjectAttributes(): update to use above * upgrade.php: overwrite DATETIME_FORMAT value * install.php: update DATETIME_FORMAT default value * resetUIConfig(): idem
- Loading branch information
1 parent
3be783f
commit 17c1470
Showing
7 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters