Skip to content
This repository
Browse code

fix RegExp issue in FF 3.6 being strange and shit w/ the global flag,…

… resolved issue #10
  • Loading branch information...
commit ed97c2e4bdfe2ff293acd82edea46379e1e0cdb2 1 parent 18d8ea7
Long Ho authored October 19, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  src/date.js
3  src/date.js
@@ -59,6 +59,7 @@
59 59
     , SHORT_MONTHS = {}
60 60
     , SHORT_DAYS = {}
61 61
     , EXACT_DATE_TIME = {}
  62
+    , TZ_REGEXP = new RegExp('^[a-zA-Z]+/');
62 63
 
63 64
   //`{ "Jan": 0, "Feb": 1, "Mar": 2, "Apr": 3, "May": 4, "Jun": 5, "Jul": 6, "Aug": 7, "Sep": 8, "Oct": 9, "Nov": 10, "Dec": 11 }`
64 65
   for (var i = 0; i < MONTHS.length; i++) {
@@ -166,7 +167,7 @@
166 167
     if (Object.prototype.toString.call(args[0]) === '[object Array]') {
167 168
       args = args[0];
168 169
     }
169  
-    if (typeof args[args.length - 1] === 'string' && /^[a-zA-Z]+\//gi.test(args[args.length - 1])) {
  170
+    if (typeof args[args.length - 1] === 'string' && TZ_REGEXP.test(args[args.length - 1])) {
170 171
       tz = args.pop();
171 172
     }
172 173
     switch (args.length) {

0 notes on commit ed97c2e

Please sign in to comment.
Something went wrong with that request. Please try again.