toLocaleFormat/PRMJ_FormatTime/strftime don't support "%e" on Windows

RESOLVED DUPLICATE of bug 818634

Status

()

defect
RESOLVED DUPLICATE of bug 818634
11 years ago
2 years ago

People

(Reporter: steffen.wilberg, Unassigned)

Tracking

(Blocks 1 bug)

Trunk
x86
Windows Vista
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

11 years ago
toLocaleFormat/PRMJ_FormatTime/strftime don't support "%e" (one- or two-digit day: 1-31) on Windows. "%d" (two-digit day: 01-31) works though.

alert(new Date().toLocaleFormat("%B %e"));
RESULT:   Tue Oct 9 2008 17:21:00 GMT +0200
EXPECTED: Oktober 9.

alert(new Date().toLocaleFormat("%B %d"));
RESULT: Oktober 09 (as expected).

This is because PRMJ_FormatTime fails here:
http://hg.mozilla.org/mozilla-central/annotate/9cf56b1047d4/js/src/jsdate.cpp#l1783

And this is because strftime doesn't support "%e" on Windows:
http://msdn.microsoft.com/en-us/library/fe06s4ak%28VS.80%29.aspx

Can we work around this in PRMJ_FormatTime by using %d and stripping any leading zeroes?
Assignee: general → nobody
toLocaleFormat was removed in bug 818634.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 818634
You need to log in before you can comment on or make changes to this bug.