Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add y pattern to CDateTimeParser #2119

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions framework/utils/CDateTimeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* MM | Month digit 01 to 12, zero leading
* MMM | Abbreviation representation of month (available since 1.1.11; locale aware since 1.1.13)
* MMMM | Full name representation (available since 1.1.13; locale aware)
* y | 4 year digit, e.g., 2005 (available since 1.1.14)
* yy | 2 year digit, e.g., 96, 05
* yyyy | 4 year digit, e.g., 2005
* h | Hour in 0 to 23, no padding
Expand Down Expand Up @@ -90,6 +91,7 @@ public static function parse($value,$pattern='MM/dd/yyyy',$defaults=array())
switch($token)
{
case 'yyyy':
case 'y':
{
if(($year=self::parseInteger($value,$i,4,4))===false)
return false;
Expand Down