format_date function returns false (Windows)

Bug #1670885 reported by Gregor Anželj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Gregor Anželj

Bug Description

format_date() function uses undelying strftime function.

It is known that %e modifier is not supported. However when I use format_date() function with the following formatkey 'strftimedatetime' which translates to '%%d %%B %%Y, %%l:%%M %%p' (for English language) the functon returns false.

According to http://stackoverflow.com/questions/12362179/why-does-strftime-on-windows-returns-false-im-not-using-e the modifier %l is the problematic one. If it is changed to %#I (under Windows) then it works as expected...

Changed in mahara:
assignee: nobody → Gregor Anželj (gregor-anzelj)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/7509

Revision history for this message
Gregor Anželj (gregor-anzelj) wrote :
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

When testing this patch, it needs to be checked that the date display for date and time is still the same as in 16.10. The best to check is in the forums as a forum entry contains the date and the time.

Changed in mahara:
status: New → In Progress
importance: Undecided → Medium
milestone: none → 17.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7509
Committed: https://git.mahara.org/mahara/mahara/commit/e707353a34ab9a6cb534290fb5db9f728d7b56d9
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit e707353a34ab9a6cb534290fb5db9f728d7b56d9
Author: Gregor Anzelj <email address hidden>
Date: Mon Feb 20 03:14:16 2017 +0100

format_date function returns false (Bug #1670885)

It is known that under Windows the %e modifier of strftime
function is problematic. Modifier %l is also problematic and
must be replced with %#I so that format_date will work under
Windows.

behatnotneeded

Change-Id: I7c0dec6bfd220fbd79a5608a28d152f41df47b6b

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.