Closed Bug 475803 Opened 15 years ago Closed 15 years ago

cal.fromRFC3339 matches fails to set timezone correctly


(Calendar :: Provider: GData, defect)

Not set


(Not tracked)



(Reporter: clokep, Assigned: clokep)



(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20081204 Lightning/1.0pre Thunderbird/3.0b1

If a lowercase 'z' is given for the timezone information of the UTC string it matches the regular expression but then will not set the timezone as UTC.

Reproducible: Always

Steps to Reproduce:
1. Feed an RFC 3339 time to cal.fromRFC3339 with a timezone of 'z'
2. Example: "2050-11-14t13:30:53z"

Actual Results:  
The timezone gets parsed as calendarDefaultTimezone instead of UTC

Expected Results:  
The timezone should get parsed as UTC
afaik a lowercase z is not allowed in the spec?
Attached patch Fixes the described error (obsolete) — Splinter Review
Attachment #359358 - Flags: review?(philipp)
Attachment #359358 - Attachment is obsolete: true
Attachment #359358 - Flags: review?(philipp)

On page "7" (section: "5.6. Internet Date/Time Format"):

"NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
syntax may alternatively be lower case "t" or "z" respectively.

This date/time format may be used in some environments or contexts
that distinguish between the upper- and lower-case letters 'A'-'Z'
and 'a'-'z' (e.g. XML).  Specifications that use this format in
such environments MAY further limit the date/time syntax so that
the letters 'T' and 'Z' used in the date/time syntax must always
be upper case.  Applications that generate this format SHOULD use
upper case letters."

Although as I'm re-reading this again that may be referring to only ISO 8601, in which case this bug is incorrect. Its kind of ambigious whether its referring to ISO 8601 or 'THIS' profile of ISO 8601 (meaning RFC 3339).
Also, the regex checks for "Tt" and "Zz", if "z" can match in the regex the rest of the script needs to be able to handle it. So either the regex needs to be set to be "T" and "Z" or the patch I proposed needs to be added (which simply checks for "Z" or "z" when setting the timezone).
Comment on attachment 359365 [details] [diff] [review]
Slight fix to the previous patch

Next time, please request review.

Attachment #359365 - Flags: review+
Assignee: nobody → DarkJedi613
Ever confirmed: true
Hardware: x86 → All
Target Milestone: --- → 1.0
Checked in:
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.