sugar-rails 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. data/copy_release.sh +28 -0
  2. data/lib/sugar/rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/precompiled/development/array.js +6 -4
  4. data/vendor/assets/javascripts/precompiled/development/date.js +45 -31
  5. data/vendor/assets/javascripts/precompiled/development/date_locales.js +274 -47
  6. data/vendor/assets/javascripts/precompiled/development/number.js +2 -2
  7. data/vendor/assets/javascripts/precompiled/development/object.js +2 -2
  8. data/vendor/assets/javascripts/precompiled/minified/array.js +15 -15
  9. data/vendor/assets/javascripts/precompiled/minified/core.js +9 -9
  10. data/vendor/assets/javascripts/precompiled/minified/date.js +40 -40
  11. data/vendor/assets/javascripts/precompiled/minified/date_locales.js +33 -22
  12. data/vendor/assets/javascripts/precompiled/minified/date_ranges.js +2 -2
  13. data/vendor/assets/javascripts/precompiled/minified/es5.js +8 -8
  14. data/vendor/assets/javascripts/precompiled/minified/function.js +4 -4
  15. data/vendor/assets/javascripts/precompiled/minified/inflections.js +5 -5
  16. data/vendor/assets/javascripts/precompiled/minified/language.js +5 -5
  17. data/vendor/assets/javascripts/precompiled/minified/number.js +5 -5
  18. data/vendor/assets/javascripts/precompiled/minified/object.js +5 -5
  19. data/vendor/assets/javascripts/precompiled/minified/regexp.js +2 -2
  20. data/vendor/assets/javascripts/precompiled/minified/string.js +11 -11
  21. data/vendor/assets/javascripts/sugar-development.js +330 -87
  22. data/vendor/assets/javascripts/sugar-full.js +145 -134
  23. data/vendor/assets/javascripts/sugar.js +102 -102
  24. metadata +5 -4
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Sugar Library v1.3.4
2
+ * Sugar Library v1.3.5
3
3
  *
4
4
  * Freely distributable and licensed under the MIT-style license.
5
5
  * Copyright (c) 2012 Andrew Plummer
@@ -1158,13 +1158,15 @@
1158
1158
  *
1159
1159
  ***/
1160
1160
  'create': function() {
1161
- var result = []
1161
+ var result = [], tmp;
1162
1162
  multiArgs(arguments, function(a) {
1163
1163
  if(isObjectPrimitive(a)) {
1164
- result = result.concat(array.prototype.slice.call(a));
1165
- } else {
1166
- result.push(a);
1164
+ tmp = array.prototype.slice.call(a);
1165
+ if(tmp.length > 0) {
1166
+ a = tmp;
1167
+ }
1167
1168
  }
1169
+ result = result.concat(a);
1168
1170
  });
1169
1171
  return result;
1170
1172
  }
@@ -2124,6 +2126,7 @@
2124
2126
  {
2125
2127
  token: '[Tt]{1,2}',
2126
2128
  format: function(d, loc, n, format) {
2129
+ if(loc['ampm'].length == 0) return '';
2127
2130
  var hours = callDateGet(d, 'Hours');
2128
2131
  var str = loc['ampm'][floor(hours / 12)];
2129
2132
  if(format.length === 1) str = str.slice(0,1);
@@ -2280,7 +2283,7 @@
2280
2283
  return English['units'][this['units'].indexOf(n) % 8];
2281
2284
  },
2282
2285
 
2283
- relative: function(adu) {
2286
+ getRelativeFormat: function(adu) {
2284
2287
  return this.convertAdjustedToFormat(adu, adu[2] > 0 ? 'future' : 'past');
2285
2288
  },
2286
2289
 
@@ -2298,25 +2301,23 @@
2298
2301
  },
2299
2302
 
2300
2303
  matchPM: function(str) {
2301
- return str === this['ampm'][1];
2304
+ return str && str === this['ampm'][1];
2302
2305
  },
2303
2306
 
2304
- convertAdjustedToFormat: function(adu, format) {
2305
- var num = adu[0], u = adu[1], ms = adu[2], sign, unit, last, mult;
2306
- if(this['code'] == 'ru') {
2307
- last = num.toString().slice(-1);
2308
- switch(true) {
2309
- case last == 1: mult = 1; break;
2310
- case last >= 2 && last <= 4: mult = 2; break;
2311
- default: mult = 3;
2312
- }
2313
- } else {
2314
- mult = this['plural'] && num > 1 ? 1 : 0;
2307
+ convertAdjustedToFormat: function(adu, mode) {
2308
+ var sign, unit, mult,
2309
+ num = adu[0],
2310
+ u = adu[1],
2311
+ ms = adu[2],
2312
+ format = this[mode] || this['relative'];
2313
+ if(isFunction(format)) {
2314
+ return format.call(this, num, u, ms, mode);
2315
2315
  }
2316
+ mult = this['plural'] && num > 1 ? 1 : 0;
2316
2317
  unit = this['units'][mult * 8 + u] || this['units'][u];
2317
2318
  if(this['capitalizeUnit']) unit = simpleCapitalize(unit);
2318
2319
  sign = this['modifiers'].filter(function(m) { return m.name == 'sign' && m.value == (ms > 0 ? 1 : -1); })[0];
2319
- return this[format].replace(/\{(.*?)\}/g, function(full, match) {
2320
+ return format.replace(/\{(.*?)\}/g, function(full, match) {
2320
2321
  switch(match) {
2321
2322
  case 'num': return num;
2322
2323
  case 'unit': return unit;
@@ -2334,9 +2335,13 @@
2334
2335
 
2335
2336
  src = src.replace(/\s+/g, '[-,. ]*');
2336
2337
  src = src.replace(/\{([^,]+?)\}/g, function(all, k) {
2337
- var opt = k.match(/\?$/), slice = k.match(/(\d)(?:-(\d))?/), nc = k.match(/^\d+$/), key = k.replace(/[^a-z]+$/, ''), value, arr;
2338
+ var value, arr, result,
2339
+ opt = k.match(/\?$/),
2340
+ nc = k.match(/^(\d+)\??$/),
2341
+ slice = k.match(/(\d)(?:-(\d))?/),
2342
+ key = k.replace(/[^a-z]+$/, '');
2338
2343
  if(nc) {
2339
- value = loc['optionals'][nc[0]];
2344
+ value = loc['tokens'][nc[1]];
2340
2345
  } else if(loc[key]) {
2341
2346
  value = loc[key];
2342
2347
  } else if(loc[key + 's']) {
@@ -2356,13 +2361,17 @@
2356
2361
  value = arrayToAlternates(value);
2357
2362
  }
2358
2363
  if(nc) {
2359
- return '(?:' + value + ')?';
2364
+ result = '(?:' + value + ')';
2360
2365
  } else {
2361
2366
  if(!match) {
2362
2367
  to.push(key);
2363
2368
  }
2364
- return '(' + value + ')' + (opt ? '?' : '');
2369
+ result = '(' + value + ')';
2365
2370
  }
2371
+ if(opt) {
2372
+ result += '?';
2373
+ }
2374
+ return result;
2366
2375
  });
2367
2376
  if(allowsTime) {
2368
2377
  time = prepareTime(RequiredTime, loc, iso);
@@ -2457,7 +2466,7 @@
2457
2466
  // Initialize the locale
2458
2467
  loc = new Localization(set);
2459
2468
  initializeField('modifiers');
2460
- 'months,weekdays,units,numbers,articles,optionals,timeMarker,ampm,timeSuffixes,dateParse,timeParse'.split(',').forEach(initializeField);
2469
+ 'months,weekdays,units,numbers,articles,tokens,timeMarker,ampm,timeSuffixes,dateParse,timeParse'.split(',').forEach(initializeField);
2461
2470
 
2462
2471
  canAbbreviate = !loc['monthSuffix'];
2463
2472
 
@@ -2605,7 +2614,7 @@
2605
2614
  d.utc(forceUTC);
2606
2615
 
2607
2616
  if(isDate(f)) {
2608
- d = f.clone();
2617
+ d = new date(f.getTime());
2609
2618
  } else if(isNumber(f)) {
2610
2619
  d = new date(f);
2611
2620
  } else if(isObject(f)) {
@@ -2858,7 +2867,7 @@
2858
2867
  adu[1] = 1;
2859
2868
  adu[0] = 1;
2860
2869
  }
2861
- return loc.relative(adu);
2870
+ return loc.getRelativeFormat(adu);
2862
2871
  }
2863
2872
 
2864
2873
  format = format || 'long';
@@ -2925,6 +2934,10 @@
2925
2934
  return isDefined(getParam(key));
2926
2935
  }
2927
2936
 
2937
+ function uniqueParamExists(key, isDay) {
2938
+ return paramExists(key) || (isDay && paramExists('weekday'));
2939
+ }
2940
+
2928
2941
  function canDisambiguate() {
2929
2942
  var now = new date;
2930
2943
  return (prefer === -1 && d > now) || (prefer === 1 && d < now);
@@ -2949,7 +2962,7 @@
2949
2962
  // as setting hour: 3, minute: 345, etc.
2950
2963
  iterateOverObject(DateUnitsReversed, function(i,u) {
2951
2964
  var isDay = u.unit === 'day';
2952
- if(paramExists(u.unit) || (isDay && paramExists('weekday'))) {
2965
+ if(uniqueParamExists(u.unit, isDay)) {
2953
2966
  params.specificity = u.unit;
2954
2967
  specificityIndex = +i;
2955
2968
  return false;
@@ -2959,6 +2972,7 @@
2959
2972
  }
2960
2973
  });
2961
2974
 
2975
+
2962
2976
  // Now actually set or advance the date in order, higher units first.
2963
2977
  DateUnits.forEach(function(u,i) {
2964
2978
  var unit = u.unit, method = u.method, higherUnit = DateUnits[i - 1], value;
@@ -2993,6 +3007,7 @@
2993
3007
  }
2994
3008
  });
2995
3009
 
3010
+
2996
3011
  // If a weekday is included in the params, set it ahead of time and set the params
2997
3012
  // to reflect the updated date so that resetting works properly.
2998
3013
  if(!advance && !paramExists('day') && paramExists('weekday')) {
@@ -3003,7 +3018,7 @@
3003
3018
  if(canDisambiguate()) {
3004
3019
  iterateOverObject(DateUnitsReversed.slice(specificityIndex + 1), function(i,u) {
3005
3020
  var ambiguous = u.ambiguous || (u.unit === 'week' && paramExists('weekday'));
3006
- if(ambiguous && !paramExists(u.unit)) {
3021
+ if(ambiguous && !uniqueParamExists(u.unit, u.unit === 'day')) {
3007
3022
  d[u.addMethod](prefer);
3008
3023
  return false;
3009
3024
  }
@@ -4173,7 +4188,7 @@
4173
4188
  'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s',
4174
4189
  'numbers': 'one,two,three,four,five,six,seven,eight,nine,ten',
4175
4190
  'articles': 'a,an,the',
4176
- 'optionals': 'the,st|nd|rd|th,of',
4191
+ 'tokens': 'the,st|nd|rd|th,of',
4177
4192
  'short': '{Month} {d}, {yyyy}',
4178
4193
  'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}',
4179
4194
  'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}',
@@ -4185,7 +4200,7 @@
4185
4200
  { 'name': 'day', 'src': 'today', 'value': 0 },
4186
4201
  { 'name': 'day', 'src': 'tomorrow', 'value': 1 },
4187
4202
  { 'name': 'sign', 'src': 'ago|before', 'value': -1 },
4188
- { 'name': 'sign', 'src': 'from now|after|from|in', 'value': 1 },
4203
+ { 'name': 'sign', 'src': 'from now|after|from|in|later', 'value': 1 },
4189
4204
  { 'name': 'edge', 'src': 'last day', 'value': -2 },
4190
4205
  { 'name': 'edge', 'src': 'end', 'value': -1 },
4191
4206
  { 'name': 'edge', 'src': 'first day|beginning', 'value': 1 },
@@ -4196,20 +4211,21 @@
4196
4211
  'dateParse': [
4197
4212
  '{num} {unit} {sign}',
4198
4213
  '{sign} {num} {unit}',
4199
- '{num} {unit=4-5} {sign} {day}',
4200
4214
  '{month} {year}',
4201
4215
  '{shift} {unit=5-7}',
4202
- '{0} {edge} of {shift?} {unit=4-7?}{month?}{year?}'
4216
+ '{0?} {date}{1}',
4217
+ '{0?} {edge} of {shift?} {unit=4-7?}{month?}{year?}'
4203
4218
  ],
4204
4219
  'timeParse': [
4205
4220
  '{0} {num}{1} {day} of {month} {year?}',
4206
- '{weekday?} {month} {date}{1} {year?}',
4221
+ '{weekday?} {month} {date}{1?} {year?}',
4207
4222
  '{date} {month} {year}',
4208
4223
  '{shift} {weekday}',
4209
4224
  '{shift} week {weekday}',
4210
- '{weekday} {2} {shift} week',
4211
- '{0} {date}{1} of {month}',
4212
- '{0}{month?} {date?}{1} of {shift} {unit=6-7}'
4225
+ '{weekday} {2?} {shift} week',
4226
+ '{num} {unit=4-5} {sign} {day}',
4227
+ '{0?} {date}{1} of {month}',
4228
+ '{0?}{month?} {date?}{1?} of {shift} {unit=6-7}'
4213
4229
  ]
4214
4230
  });
4215
4231
 
@@ -4689,8 +4705,8 @@
4689
4705
  var min, max;
4690
4706
  if(arguments.length == 1) n2 = n1, n1 = 0;
4691
4707
  min = math.min(n1 || 0, isUndefined(n2) ? 1 : n2);
4692
- max = math.max(n1 || 0, isUndefined(n2) ? 1 : n2);
4693
- return round((math.random() * (max - min)) + min);
4708
+ max = math.max(n1 || 0, isUndefined(n2) ? 1 : n2) + 1;
4709
+ return floor((math.random() * (max - min)) + min);
4694
4710
  }
4695
4711
 
4696
4712
  });
@@ -5357,10 +5373,10 @@
5357
5373
  'fromQueryString': function(str, deep) {
5358
5374
  var result = object.extended(), split;
5359
5375
  str = str && str.toString ? str.toString() : '';
5360
- decodeURIComponent(str.replace(/^.*?\?/, '')).split('&').forEach(function(p) {
5376
+ str.replace(/^.*?\?/, '').split('&').forEach(function(p) {
5361
5377
  var split = p.split('=');
5362
5378
  if(split.length !== 2) return;
5363
- setParamsObject(result, split[0], split[1], deep);
5379
+ setParamsObject(result, split[0], decodeURIComponent(split[1]), deep);
5364
5380
  });
5365
5381
  return result;
5366
5382
  },
@@ -7166,6 +7182,88 @@
7166
7182
 
7167
7183
  buildUnicodeScripts();
7168
7184
 
7185
+ /*
7186
+ *
7187
+ * Date.addLocale(<code>) adds this locale to Sugar.
7188
+ * To set the locale globally, simply call:
7189
+ *
7190
+ * Date.setLocale('da');
7191
+ *
7192
+ * var locale = Date.getLocale(<code>) will return this object, which
7193
+ * can be tweaked to change the behavior of parsing/formatting in the locales.
7194
+ *
7195
+ * locale.addFormat adds a date format (see this file for examples).
7196
+ * Special tokens in the date format will be parsed out into regex tokens:
7197
+ *
7198
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7199
+ * {unit} is a reference to all units. Output: (day|week|month|...)
7200
+ * {unit3} is a reference to a specific unit. Output: (hour)
7201
+ * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
7202
+ * {unit?} "?" makes that token optional. Output: (day|week|month)?
7203
+ *
7204
+ * {day} Any reference to tokens in the modifiers array will include all with the same name. Output: (yesterday|today|tomorrow)
7205
+ *
7206
+ * All spaces are optional and will be converted to "\s*"
7207
+ *
7208
+ * Locale arrays months, weekdays, units, numbers, as well as the "src" field for
7209
+ * all entries in the modifiers array follow a special format indicated by a colon:
7210
+ *
7211
+ * minute:|s = minute|minutes
7212
+ * thicke:n|r = thicken|thicker
7213
+ *
7214
+ * Additionally in the months, weekdays, units, and numbers array these will be added at indexes that are multiples
7215
+ * of the relevant number for retrieval. For example having "sunday:|s" in the units array will result in:
7216
+ *
7217
+ * units: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sundays']
7218
+ *
7219
+ * When matched, the index will be found using:
7220
+ *
7221
+ * units.indexOf(match) % 7;
7222
+ *
7223
+ * Resulting in the correct index with any number of alternates for that entry.
7224
+ *
7225
+ */
7226
+
7227
+ Date.addLocale('da', {
7228
+ 'plural': true,
7229
+ 'months': 'januar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december',
7230
+ 'weekdays': 'søndag|sondag,mandag,tirsdag,onsdag,torsdag,fredag,lørdag|lordag',
7231
+ 'units': 'millisekund:|er,sekund:|er,minut:|ter,tim:e|er,dag:|e,ug:e|er|en,måned:|er|en+maaned:|er|en,år:||et+aar:||et',
7232
+ 'numbers': 'en|et,to,tre,fire,fem,seks,syv,otte,ni,ti',
7233
+ 'tokens': 'den,for',
7234
+ 'articles': 'den',
7235
+ 'short':'d. {d}. {month} {yyyy}',
7236
+ 'long': 'den {d}. {month} {yyyy} {H}:{mm}',
7237
+ 'full': '{Weekday} den {d}. {month} {yyyy} {H}:{mm}:{ss}',
7238
+ 'past': '{num} {unit} {sign}',
7239
+ 'future': '{sign} {num} {unit}',
7240
+ 'duration': '{num} {unit}',
7241
+ 'ampm': 'am,pm',
7242
+ 'modifiers': [
7243
+ { 'name': 'day', 'src': 'forgårs|i forgårs|forgaars|i forgaars', 'value': -2 },
7244
+ { 'name': 'day', 'src': 'i går|igår|i gaar|igaar', 'value': -1 },
7245
+ { 'name': 'day', 'src': 'i dag|idag', 'value': 0 },
7246
+ { 'name': 'day', 'src': 'i morgen|imorgen', 'value': 1 },
7247
+ { 'name': 'day', 'src': 'over morgon|overmorgen|i over morgen|i overmorgen|iovermorgen', 'value': 2 },
7248
+ { 'name': 'sign', 'src': 'siden', 'value': -1 },
7249
+ { 'name': 'sign', 'src': 'om', 'value': 1 },
7250
+ { 'name': 'shift', 'src': 'i sidste|sidste', 'value': -1 },
7251
+ { 'name': 'shift', 'src': 'denne', 'value': 0 },
7252
+ { 'name': 'shift', 'src': 'næste|naeste', 'value': 1 }
7253
+ ],
7254
+ 'dateParse': [
7255
+ '{num} {unit} {sign}',
7256
+ '{sign} {num} {unit}',
7257
+ '{1?} {num} {unit} {sign}',
7258
+ '{shift} {unit=5-7}'
7259
+ ],
7260
+ 'timeParse': [
7261
+ '{0?} {weekday?} {date?} {month} {year}',
7262
+ '{date} {month}',
7263
+ '{shift} {weekday}'
7264
+ ]
7265
+ });
7266
+
7169
7267
  /*
7170
7268
  *
7171
7269
  * Date.addLocale(<code>) adds this locale to Sugar.
@@ -7179,7 +7277,7 @@
7179
7277
  * locale.addFormat adds a date format (see this file for examples).
7180
7278
  * Special tokens in the date format will be parsed out into regex tokens:
7181
7279
  *
7182
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7280
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7183
7281
  * {unit} is a reference to all units. Output: (day|week|month|...)
7184
7282
  * {unit3} is a reference to a specific unit. Output: (hour)
7185
7283
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7215,7 +7313,7 @@ Date.addLocale('de', {
7215
7313
  'weekdays': 'Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag',
7216
7314
  'units': 'Millisekunde:|n,Sekunde:|n,Minute:|n,Stunde:|n,Tag:|en,Woche:|n,Monat:|en,Jahr:|en',
7217
7315
  'numbers': 'ein:|e|er|en|em,zwei,drei,vier,fuenf,sechs,sieben,acht,neun,zehn',
7218
- 'optionals': 'der',
7316
+ 'tokens': 'der',
7219
7317
  'short':'{d}. {Month} {yyyy}',
7220
7318
  'long': '{d}. {Month} {yyyy} {H}:{mm}',
7221
7319
  'full': '{Weekday} {d}. {Month} {yyyy} {H}:{mm}:{ss}',
@@ -7259,7 +7357,7 @@ Date.addLocale('de', {
7259
7357
  * locale.addFormat adds a date format (see this file for examples).
7260
7358
  * Special tokens in the date format will be parsed out into regex tokens:
7261
7359
  *
7262
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7360
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7263
7361
  * {unit} is a reference to all units. Output: (day|week|month|...)
7264
7362
  * {unit3} is a reference to a specific unit. Output: (hour)
7265
7363
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7294,7 +7392,7 @@ Date.addLocale('es', {
7294
7392
  'weekdays': 'domingo,lunes,martes,miércoles|miercoles,jueves,viernes,sábado|sabado',
7295
7393
  'units': 'milisegundo:|s,segundo:|s,minuto:|s,hora:|s,día|días|dia|dias,semana:|s,mes:|es,año|años|ano|anos',
7296
7394
  'numbers': 'uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve,diez',
7297
- 'optionals': 'el,de',
7395
+ 'tokens': 'el,de',
7298
7396
  'short':'{d} {month} {yyyy}',
7299
7397
  'long': '{d} {month} {yyyy} {H}:{mm}',
7300
7398
  'full': '{Weekday} {d} {month} {yyyy} {H}:{mm}:{ss}',
@@ -7316,15 +7414,72 @@ Date.addLocale('es', {
7316
7414
  'dateParse': [
7317
7415
  '{sign} {num} {unit}',
7318
7416
  '{num} {unit} {sign}',
7319
- '{0} {unit=5-7} {shift}',
7320
- '{0} {shift} {unit=5-7}'
7417
+ '{0?} {unit=5-7} {shift}',
7418
+ '{0?} {shift} {unit=5-7}'
7321
7419
  ],
7322
7420
  'timeParse': [
7323
7421
  '{shift} {weekday}',
7324
7422
  '{weekday} {shift}',
7325
- '{date?} {1} {month} {1} {year?}'
7423
+ '{date?} {1?} {month} {1?} {year?}'
7326
7424
  ]
7327
7425
  });
7426
+ Date.addLocale('fi', {
7427
+ 'plural': true,
7428
+ 'timeMarker': 'kello',
7429
+ 'ampm': ',',
7430
+ 'months': 'tammikuu,helmikuu,maaliskuu,huhtikuu,toukokuu,kesäkuu,heinäkuu,elokuu,syyskuu,lokakuu,marraskuu,joulukuu',
7431
+ 'weekdays': 'sunnuntai,maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai',
7432
+ 'units': 'millisekun:ti|tia|teja|tina|nin,sekun:ti|tia|teja|tina|nin,minuut:ti|tia|teja|tina|in,tun:ti|tia|teja|tina|nin,päiv:ä|ää|iä|änä|än,viik:ko|koa|koja|on|kona,kuukau:si|sia|tta|den|tena,vuo:si|sia|tta|den|tena',
7433
+ 'numbers': 'yksi|ensimmäinen,kaksi|toinen,kolm:e|as,neljä:s,vii:si|des,kuu:si|des,seitsemä:n|s,kahdeksa:n|s,yhdeksä:n|s,kymmene:n|s',
7434
+ 'articles': '',
7435
+ 'optionals': '',
7436
+ 'short': '{d}. {month}ta {yyyy}',
7437
+ 'long': '{d}. {month}ta {yyyy} kello {H}.{mm}',
7438
+ 'full': '{Weekday}na {d}. {month}ta {yyyy} kello {H}.{mm}',
7439
+ 'relative': function(num, unit, ms, format) {
7440
+ var units = this['units'];
7441
+ function numberWithUnit(mult) {
7442
+ return (num === 1 ? '' : num + ' ') + units[(8 * mult) + unit];
7443
+ }
7444
+ switch(format) {
7445
+ case 'duration': return numberWithUnit(0);
7446
+ case 'past': return numberWithUnit(num > 1 ? 1 : 0) + ' sitten';
7447
+ case 'future': return numberWithUnit(4) + ' päästä';
7448
+ }
7449
+ },
7450
+ 'modifiers': [
7451
+ { 'name': 'day', 'src': 'toissa päivänä|toissa päiväistä', 'value': -2 },
7452
+ { 'name': 'day', 'src': 'eilen|eilistä', 'value': -1 },
7453
+ { 'name': 'day', 'src': 'tänään', 'value': 0 },
7454
+ { 'name': 'day', 'src': 'huomenna|huomista', 'value': 1 },
7455
+ { 'name': 'day', 'src': 'ylihuomenna|ylihuomista', 'value': 2 },
7456
+ { 'name': 'sign', 'src': 'sitten|aiemmin', 'value': -1 },
7457
+ { 'name': 'sign', 'src': 'päästä|kuluttua|myöhemmin', 'value': 1 },
7458
+ { 'name': 'edge', 'src': 'viimeinen|viimeisenä', 'value': -2 },
7459
+ { 'name': 'edge', 'src': 'lopussa', 'value': -1 },
7460
+ { 'name': 'edge', 'src': 'ensimmäinen|ensimmäisenä', 'value': 1 },
7461
+ { 'name': 'shift', 'src': 'edellinen|edellisenä|edeltävä|edeltävänä|viime|toissa', 'value': -1 },
7462
+ { 'name': 'shift', 'src': 'tänä|tämän', 'value': 0 },
7463
+ { 'name': 'shift', 'src': 'seuraava|seuraavana|tuleva|tulevana|ensi', 'value': 1 }
7464
+ ],
7465
+ 'dateParse': [
7466
+ '{num} {unit} {sign}',
7467
+ '{sign} {num} {unit}',
7468
+ '{num} {unit=4-5} {sign} {day}',
7469
+ '{month} {year}',
7470
+ '{shift} {unit=5-7}'
7471
+ ],
7472
+ 'timeParse': [
7473
+ '{0} {num}{1} {day} of {month} {year?}',
7474
+ '{weekday?} {month} {date}{1} {year?}',
7475
+ '{date} {month} {year}',
7476
+ '{shift} {weekday}',
7477
+ '{shift} week {weekday}',
7478
+ '{weekday} {2} {shift} week',
7479
+ '{0} {date}{1} of {month}',
7480
+ '{0}{month?} {date?}{1} of {shift} {unit=6-7}'
7481
+ ]
7482
+ });
7328
7483
  /*
7329
7484
  *
7330
7485
  * Date.addLocale(<code>) adds this locale to Sugar.
@@ -7338,7 +7493,7 @@ Date.addLocale('es', {
7338
7493
  * locale.addFormat adds a date format (see this file for examples).
7339
7494
  * Special tokens in the date format will be parsed out into regex tokens:
7340
7495
  *
7341
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7496
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7342
7497
  * {unit} is a reference to all units. Output: (day|week|month|...)
7343
7498
  * {unit3} is a reference to a specific unit. Output: (hour)
7344
7499
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7373,7 +7528,7 @@ Date.addLocale('fr', {
7373
7528
  'weekdays': 'dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi',
7374
7529
  'units': 'milliseconde:|s,seconde:|s,minute:|s,heure:|s,jour:|s,semaine:|s,mois,an:|s|née|nee',
7375
7530
  'numbers': 'un:|e,deux,trois,quatre,cinq,six,sept,huit,neuf,dix',
7376
- 'optionals': ["l'|la|le"],
7531
+ 'tokens': ["l'|la|le"],
7377
7532
  'short':'{d} {month} {yyyy}',
7378
7533
  'long': '{d} {month} {yyyy} {H}:{mm}',
7379
7534
  'full': '{Weekday} {d} {month} {yyyy} {H}:{mm}:{ss}',
@@ -7394,11 +7549,11 @@ Date.addLocale('fr', {
7394
7549
  'dateParse': [
7395
7550
  '{sign} {num} {unit}',
7396
7551
  '{sign} {num} {unit}',
7397
- '{0} {unit=5-7} {shift}'
7552
+ '{0?} {unit=5-7} {shift}'
7398
7553
  ],
7399
7554
  'timeParse': [
7400
- '{0} {date?} {month} {year?}',
7401
- '{0} {weekday} {shift}'
7555
+ '{0?} {date?} {month} {year?}',
7556
+ '{0?} {weekday} {shift}'
7402
7557
  ]
7403
7558
  });
7404
7559
 
@@ -7415,7 +7570,7 @@ Date.addLocale('fr', {
7415
7570
  * locale.addFormat adds a date format (see this file for examples).
7416
7571
  * Special tokens in the date format will be parsed out into regex tokens:
7417
7572
  *
7418
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7573
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7419
7574
  * {unit} is a reference to all units. Output: (day|week|month|...)
7420
7575
  * {unit3} is a reference to a specific unit. Output: (hour)
7421
7576
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7450,7 +7605,7 @@ Date.addLocale('it', {
7450
7605
  'weekdays': 'Domenica,Luned:ì|i,Marted:ì|i,Mercoled:ì|i,Gioved:ì|i,Venerd:ì|i,Sabato',
7451
7606
  'units': 'millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i',
7452
7607
  'numbers': "un:|a|o|',due,tre,quattro,cinque,sei,sette,otto,nove,dieci",
7453
- 'optionals': "l'|la|il",
7608
+ 'tokens': "l'|la|il",
7454
7609
  'short':'{d} {Month} {yyyy}',
7455
7610
  'long': '{d} {Month} {yyyy} {H}:{mm}',
7456
7611
  'full': '{Weekday} {d} {Month} {yyyy} {H}:{mm}:{ss}',
@@ -7471,8 +7626,8 @@ Date.addLocale('it', {
7471
7626
  ],
7472
7627
  'dateParse': [
7473
7628
  '{num} {unit} {sign}',
7474
- '{0} {unit=5-7} {shift}',
7475
- '{0} {shift} {unit=5-7}'
7629
+ '{0?} {unit=5-7} {shift}',
7630
+ '{0?} {shift} {unit=5-7}'
7476
7631
  ],
7477
7632
  'timeParse': [
7478
7633
  '{weekday?} {date?} {month} {year?}',
@@ -7493,7 +7648,7 @@ Date.addLocale('it', {
7493
7648
  * locale.addFormat adds a date format (see this file for examples).
7494
7649
  * Special tokens in the date format will be parsed out into regex tokens:
7495
7650
  *
7496
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7651
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7497
7652
  * {unit} is a reference to all units. Output: (day|week|month|...)
7498
7653
  * {unit3} is a reference to a specific unit. Output: (hour)
7499
7654
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7569,7 +7724,7 @@ Date.addLocale('ja', {
7569
7724
  * locale.addFormat adds a date format (see this file for examples).
7570
7725
  * Special tokens in the date format will be parsed out into regex tokens:
7571
7726
  *
7572
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7727
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7573
7728
  * {unit} is a reference to all units. Output: (day|week|month|...)
7574
7729
  * {unit3} is a reference to a specific unit. Output: (hour)
7575
7730
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7636,6 +7791,82 @@ Date.addLocale('ko', {
7636
7791
  ]
7637
7792
  });
7638
7793
 
7794
+ /*
7795
+ *
7796
+ * Date.addLocale(<code>) adds this locale to Sugar.
7797
+ * To set the locale globally, simply call:
7798
+ *
7799
+ * Date.setLocale('nl');
7800
+ *
7801
+ * var locale = Date.getLocale(<code>) will return this object, which
7802
+ * can be tweaked to change the behavior of parsing/formatting in the locales.
7803
+ *
7804
+ * locale.addFormat adds a date format (see this file for examples).
7805
+ * Special tokens in the date format will be parsed out into regex tokens:
7806
+ *
7807
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7808
+ * {unit} is a reference to all units. Output: (day|week|month|...)
7809
+ * {unit3} is a reference to a specific unit. Output: (hour)
7810
+ * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
7811
+ * {unit?} "?" makes that token optional. Output: (day|week|month)?
7812
+ *
7813
+ * {day} Any reference to tokens in the modifiers array will include all with the same name. Output: (yesterday|today|tomorrow)
7814
+ *
7815
+ * All spaces are optional and will be converted to "\s*"
7816
+ *
7817
+ * Locale arrays months, weekdays, units, numbers, as well as the "src" field for
7818
+ * all entries in the modifiers array follow a special format indicated by a colon:
7819
+ *
7820
+ * minute:|s = minute|minutes
7821
+ * thicke:n|r = thicken|thicker
7822
+ *
7823
+ * Additionally in the months, weekdays, units, and numbers array these will be added at indexes that are multiples
7824
+ * of the relevant number for retrieval. For example having "sunday:|s" in the units array will result in:
7825
+ *
7826
+ * units: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sundays']
7827
+ *
7828
+ * When matched, the index will be found using:
7829
+ *
7830
+ * units.indexOf(match) % 7;
7831
+ *
7832
+ * Resulting in the correct index with any number of alternates for that entry.
7833
+ *
7834
+ */
7835
+
7836
+ Date.addLocale('nl', {
7837
+ 'plural': true,
7838
+ 'months': 'januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december',
7839
+ 'weekdays': 'zondag|zo,maandag|ma,dinsdag|di,woensdag|woe|wo,donderdag|do,vrijdag|vrij|vr,zaterdag|za',
7840
+ 'units': 'milliseconde:|n,seconde:|n,minu:ut|ten,uur,dag:|en,we:ek|ken,maand:|en,jaar',
7841
+ 'numbers': 'een,twee,drie,vier,vijf,zes,zeven,acht,negen',
7842
+ 'tokens': '',
7843
+ 'short':'{d} {Month} {yyyy}',
7844
+ 'long': '{d} {Month} {yyyy} {H}:{mm}',
7845
+ 'full': '{Weekday} {d} {Month} {yyyy} {H}:{mm}:{ss}',
7846
+ 'past': '{num} {unit} {sign}',
7847
+ 'future': '{num} {unit} {sign}',
7848
+ 'duration': '{num} {unit}',
7849
+ 'timeMarker': "'s|om",
7850
+ 'modifiers': [
7851
+ { 'name': 'day', 'src': 'gisteren', 'value': -1 },
7852
+ { 'name': 'day', 'src': 'vandaag', 'value': 0 },
7853
+ { 'name': 'day', 'src': 'morgen', 'value': 1 },
7854
+ { 'name': 'day', 'src': 'overmorgen', 'value': 2 },
7855
+ { 'name': 'sign', 'src': 'geleden', 'value': -1 },
7856
+ { 'name': 'sign', 'src': 'vanaf nu', 'value': 1 },
7857
+ { 'name': 'shift', 'src': 'laatste|vorige|afgelopen', 'value': -1 },
7858
+ { 'name': 'shift', 'src': 'volgend:|e', 'value': 1 }
7859
+ ],
7860
+ 'dateParse': [
7861
+ '{num} {unit} {sign}',
7862
+ '{0?} {unit=5-7} {shift}',
7863
+ '{0?} {shift} {unit=5-7}'
7864
+ ],
7865
+ 'timeParse': [
7866
+ '{weekday?} {date?} {month} {year?}',
7867
+ '{shift} {weekday}'
7868
+ ]
7869
+ });
7639
7870
  /*
7640
7871
  *
7641
7872
  * Date.addLocale(<code>) adds this locale to Sugar.
@@ -7730,7 +7961,7 @@ Date.addLocale('pl', {
7730
7961
  * locale.addFormat adds a date format (see this file for examples).
7731
7962
  * Special tokens in the date format will be parsed out into regex tokens:
7732
7963
  *
7733
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
7964
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7734
7965
  * {unit} is a reference to all units. Output: (day|week|month|...)
7735
7966
  * {unit3} is a reference to a specific unit. Output: (hour)
7736
7967
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7765,7 +7996,7 @@ Date.addLocale('pt', {
7765
7996
  'weekdays': 'domingo,segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado|sabado',
7766
7997
  'units': 'milisegundo:|s,segundo:|s,minuto:|s,hora:|s,dia:|s,semana:|s,mês|mêses|mes|meses,ano:|s',
7767
7998
  'numbers': 'um,dois,três|tres,quatro,cinco,seis,sete,oito,nove,dez,uma,duas',
7768
- 'optionals': 'a,de',
7999
+ 'tokens': 'a,de',
7769
8000
  'short':'{d} de {month} de {yyyy}',
7770
8001
  'long': '{d} de {month} de {yyyy} {H}:{mm}',
7771
8002
  'full': '{Weekday}, {d} de {month} de {yyyy} {H}:{mm}:{ss}',
@@ -7787,12 +8018,12 @@ Date.addLocale('pt', {
7787
8018
  'dateParse': [
7788
8019
  '{num} {unit} {sign}',
7789
8020
  '{sign} {num} {unit}',
7790
- '{0} {unit=5-7} {shift}',
7791
- '{0} {shift} {unit=5-7}'
8021
+ '{0?} {unit=5-7} {shift}',
8022
+ '{0?} {shift} {unit=5-7}'
7792
8023
  ],
7793
8024
  'timeParse': [
7794
- '{date?} {1} {month} {1} {year?}',
7795
- '{0} {shift} {weekday}'
8025
+ '{date?} {1?} {month} {1?} {year?}',
8026
+ '{0?} {shift} {weekday}'
7796
8027
  ]
7797
8028
  });
7798
8029
 
@@ -7809,7 +8040,7 @@ Date.addLocale('pt', {
7809
8040
  * locale.addFormat adds a date format (see this file for examples).
7810
8041
  * Special tokens in the date format will be parsed out into regex tokens:
7811
8042
  *
7812
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
8043
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7813
8044
  * {unit} is a reference to all units. Output: (day|week|month|...)
7814
8045
  * {unit3} is a reference to a specific unit. Output: (hour)
7815
8046
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7843,13 +8074,25 @@ Date.addLocale('ru', {
7843
8074
  'weekdays': 'Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота',
7844
8075
  'units': 'миллисекунд:а|у|ы|,секунд:а|у|ы|,минут:а|у|ы|,час:||а|ов,день|день|дня|дней,недел:я|ю|и|ь|е,месяц:||а|ев|е,год|год|года|лет|году',
7845
8076
  'numbers': 'од:ин|ну,дв:а|е,три,четыре,пять,шесть,семь,восемь,девять,десять',
7846
- 'optionals': 'в|на,года',
8077
+ 'tokens': 'в|на,года',
7847
8078
  'short':'{d} {month} {yyyy} года',
7848
8079
  'long': '{d} {month} {yyyy} года {H}:{mm}',
7849
8080
  'full': '{Weekday} {d} {month} {yyyy} года {H}:{mm}:{ss}',
7850
- 'past': '{num} {unit} {sign}',
7851
- 'future': '{sign} {num} {unit}',
7852
- 'duration': '{num} {unit}',
8081
+ 'relative': function(num, unit, ms, format) {
8082
+ var numberWithUnit, last = num.toString().slice(-1);
8083
+ switch(true) {
8084
+ case num >= 11 && num <= 15: mult = 3; break;
8085
+ case last == 1: mult = 1; break;
8086
+ case last >= 2 && last <= 4: mult = 2; break;
8087
+ default: mult = 3;
8088
+ }
8089
+ numberWithUnit = num + ' ' + this['units'][(mult * 8) + unit];
8090
+ switch(format) {
8091
+ case 'duration': return numberWithUnit;
8092
+ case 'past': return numberWithUnit + ' назад';
8093
+ case 'future': return 'через ' + numberWithUnit;
8094
+ }
8095
+ },
7853
8096
  'timeMarker': 'в',
7854
8097
  'ampm': ' утра, вечера',
7855
8098
  'modifiers': [
@@ -7867,11 +8110,11 @@ Date.addLocale('ru', {
7867
8110
  '{num} {unit} {sign}',
7868
8111
  '{sign} {num} {unit}',
7869
8112
  '{month} {year}',
7870
- '{0} {shift} {unit=5-7}'
8113
+ '{0?} {shift} {unit=5-7}'
7871
8114
  ],
7872
8115
  'timeParse': [
7873
- '{date} {month} {year?} {1}',
7874
- '{0} {shift} {weekday}'
8116
+ '{date} {month} {year?} {1?}',
8117
+ '{0?} {shift} {weekday}'
7875
8118
  ]
7876
8119
  });
7877
8120
 
@@ -7888,7 +8131,7 @@ Date.addLocale('ru', {
7888
8131
  * locale.addFormat adds a date format (see this file for examples).
7889
8132
  * Special tokens in the date format will be parsed out into regex tokens:
7890
8133
  *
7891
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
8134
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7892
8135
  * {unit} is a reference to all units. Output: (day|week|month|...)
7893
8136
  * {unit3} is a reference to a specific unit. Output: (hour)
7894
8137
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -7923,7 +8166,7 @@ Date.addLocale('sv', {
7923
8166
  'weekdays': 'söndag|sondag,måndag:|en+mandag:|en,tisdag,onsdag,torsdag,fredag,lördag|lordag',
7924
8167
  'units': 'millisekund:|er,sekund:|er,minut:|er,timm:e|ar,dag:|ar,veck:a|or|an,månad:|er|en+manad:|er|en,år:||et+ar:||et',
7925
8168
  'numbers': 'en|ett,två|tva,tre,fyra,fem,sex,sju,åtta|atta,nio,tio',
7926
- 'optionals': 'den,för|for',
8169
+ 'tokens': 'den,för|for',
7927
8170
  'articles': 'den',
7928
8171
  'short':'den {d} {month} {yyyy}',
7929
8172
  'long': 'den {d} {month} {yyyy} {H}:{mm}',
@@ -7947,11 +8190,11 @@ Date.addLocale('sv', {
7947
8190
  'dateParse': [
7948
8191
  '{num} {unit} {sign}',
7949
8192
  '{sign} {num} {unit}',
7950
- '{1} {num} {unit} {sign}',
7951
- '{shift} {unit5-7}'
8193
+ '{1?} {num} {unit} {sign}',
8194
+ '{shift} {unit=5-7}'
7952
8195
  ],
7953
8196
  'timeParse': [
7954
- '{0} {weekday?} {date?} {month} {year}',
8197
+ '{0?} {weekday?} {date?} {month} {year}',
7955
8198
  '{date} {month}',
7956
8199
  '{shift} {weekday}'
7957
8200
  ]
@@ -7970,7 +8213,7 @@ Date.addLocale('sv', {
7970
8213
  * locale.addFormat adds a date format (see this file for examples).
7971
8214
  * Special tokens in the date format will be parsed out into regex tokens:
7972
8215
  *
7973
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
8216
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
7974
8217
  * {unit} is a reference to all units. Output: (day|week|month|...)
7975
8218
  * {unit3} is a reference to a specific unit. Output: (hour)
7976
8219
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -8004,7 +8247,7 @@ Date.addLocale('zh-CN', {
8004
8247
  'monthSuffix': '月',
8005
8248
  'weekdays': '星期日|周日,星期一|周一,星期二|周二,星期三|周三,星期四|周四,星期五|周五,星期六|周六',
8006
8249
  'units': '毫秒,秒钟,分钟,小时,天,个星期|周,个月,年',
8007
- 'optionals': '日|号',
8250
+ 'tokens': '日|号',
8008
8251
  'short':'{yyyy}年{M}月{d}日',
8009
8252
  'long': '{yyyy}年{M}月{d}日 {tt}{h}:{mm}',
8010
8253
  'full': '{yyyy}年{M}月{d}日 {weekday} {tt}{h}:{mm}:{ss}',
@@ -8031,9 +8274,9 @@ Date.addLocale('zh-CN', {
8031
8274
  ],
8032
8275
  'timeParse': [
8033
8276
  '{shift}{weekday}',
8034
- '{year}年{month?}月?{date?}{0}',
8035
- '{month}月{date?}{0}',
8036
- '{date}{0}'
8277
+ '{year}年{month?}月?{date?}{0?}',
8278
+ '{month}月{date?}{0?}',
8279
+ '{date}[日号]'
8037
8280
  ]
8038
8281
  });
8039
8282
 
@@ -8050,7 +8293,7 @@ Date.addLocale('zh-CN', {
8050
8293
  * locale.addFormat adds a date format (see this file for examples).
8051
8294
  * Special tokens in the date format will be parsed out into regex tokens:
8052
8295
  *
8053
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
8296
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
8054
8297
  * {unit} is a reference to all units. Output: (day|week|month|...)
8055
8298
  * {unit3} is a reference to a specific unit. Output: (hour)
8056
8299
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -8085,7 +8328,7 @@ Date.addLocale('zh-TW', {
8085
8328
  'monthSuffix': '月',
8086
8329
  'weekdays': '星期日|週日,星期一|週一,星期二|週二,星期三|週三,星期四|週四,星期五|週五,星期六|週六',
8087
8330
  'units': '毫秒,秒鐘,分鐘,小時,天,個星期|週,個月,年',
8088
- 'optionals': '日|號',
8331
+ 'tokens': '日|號',
8089
8332
  'short':'{yyyy}年{M}月{d}日',
8090
8333
  'long': '{yyyy}年{M}月{d}日 {tt}{h}:{mm}',
8091
8334
  'full': '{yyyy}年{M}月{d}日 {Weekday} {tt}{h}:{mm}:{ss}',
@@ -8112,9 +8355,9 @@ Date.addLocale('zh-TW', {
8112
8355
  ],
8113
8356
  'timeParse': [
8114
8357
  '{shift}{weekday}',
8115
- '{year}年{month?}月?{date?}{0}',
8116
- '{month}月{date?}{0}',
8117
- '{date}{0}'
8358
+ '{year}年{month?}月?{date?}{0?}',
8359
+ '{month}月{date?}{0?}',
8360
+ '{date}[日號]'
8118
8361
  ]
8119
8362
  });
8120
8363