You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
w2p_Utilities_Date::format('%I') drops the leading zero (testFormatTZAwareTimeWithFormat fails before 10:00) #426
Found on the dev-6.0.0 branch (local, at 9bd3a1e0) during the lib/ cleanup. It may be on master too: the same code is there.
w2p_Utilities_Date::format() maps %I (12-hour clock, two digits) to date('g'), which has no leading zero (classes/w2p/Utilities/Date.class.php, case 'I').
Any user whose time format uses %I sees times like 1:03 am instead of 01:03 am.
w2p_Core_CAppUITest::testFormatTZAwareTimeWithFormat compares against PHP's h format, so it fails whenever the current hour is 1–9 (am or pm) and passes otherwise. The suite result depends on the time of day.
Fix: use date('h', $myTime) for %I. If an unpadded hour is wanted, add %l (strftime's code for that) and map it to g.
Activity
Date::format(): pad %I to two digits