Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
1c979090
Commit
1c979090
authored
Dec 31, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2060 from edx/louyihua/tzAbbr
Fix tzAbbr() in non-English browsers #os
parents
96a3d586
fefb7757
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
AUTHORS
+1
-1
common/static/js/vendor/tzAbbr.js
+14
-2
No files found.
AUTHORS
View file @
1c979090
...
@@ -101,4 +101,4 @@ Daniel Cebrián Robles <danielcebrianr@gmail.com>
...
@@ -101,4 +101,4 @@ Daniel Cebrián Robles <danielcebrianr@gmail.com>
Carson Gee <cgee@mit.edu>
Carson Gee <cgee@mit.edu>
Gang Chen <goncha@gmail.com>
Gang Chen <goncha@gmail.com>
Bertrand Marron <bertrand.marron@ionis-group.com>
Bertrand Marron <bertrand.marron@ionis-group.com>
Yihua Lou <supermouselyh@hotmail.com>
common/static/js/vendor/tzAbbr.js
View file @
1c979090
...
@@ -9,7 +9,7 @@ stringified date as best it can and returns `null` in the few cases
...
@@ -9,7 +9,7 @@ stringified date as best it can and returns `null` in the few cases
where no friendly timezone name is found (so far, just Opera).
where no friendly timezone name is found (so far, just Opera).
Device tested & works in:
Device tested & works in:
* IE 6
, 7, 8, and 9
(latest versions of all)
* IE 6
[through] 11
(latest versions of all)
* Firefox 3 [through] 16 (16 = latest version to date)
* Firefox 3 [through] 16 (16 = latest version to date)
* Chrome 22 (latest version to date)
* Chrome 22 (latest version to date)
* Safari 6 (latest version to date)
* Safari 6 (latest version to date)
...
@@ -44,7 +44,19 @@ define([], function() {
...
@@ -44,7 +44,19 @@ define([], function() {
if
(
tzAbbr
)
{
if
(
tzAbbr
)
{
// Old Firefox uses the long timezone name (e.g., "Central
// Old Firefox uses the long timezone name (e.g., "Central
// Daylight Time" instead of "CDT")
// Daylight Time" instead of "CDT")
tzAbbr
=
tzAbbr
[
1
].
match
(
/
[
A-Z
]
/g
).
join
(
""
);
/*
If the timezone string does not cotain capital English letters
(For example, the timezone string may be a Chinese string),
then the following code line will produce a null-reference
exception, and the execution of the javascript codes will
be stopped, which may cause some strange behaviors. So a
try-catch is needed here to prevent the execution being stopped.
*/
try
{
tzAbbr
=
tzAbbr
[
1
].
match
(
/
[
A-Z
]
/g
).
join
(
""
);
}
catch
(
err
)
{
tzAbbr
=
tzAbbr
[
1
];
}
}
}
// Uncomment these lines to return a GMT offset for browsers
// Uncomment these lines to return a GMT offset for browsers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment