momentjs-rails 2.8.4 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/news.md +4 -1
  3. data/test/dummy/log/test.log +13 -0
  4. data/test/dummy/tmp/cache/assets/D3F/5F0/sprockets%2F4a6c53eae7c6e41a69a191578bbb6417 +0 -0
  5. data/test/dummy/tmp/cache/assets/D58/BD0/sprockets%2F4de9ddc9b725c715a54c98697b2528fe +0 -0
  6. data/test/dummy/tmp/cache/assets/D75/510/sprockets%2Fe690787ac522f47a6be024bfcc1767ee +0 -0
  7. data/test/integration/navigation_test.rb +1 -1
  8. data/vendor/assets/javascripts/moment.js +172 -65
  9. data/vendor/assets/javascripts/moment/af.js +4 -0
  10. data/vendor/assets/javascripts/moment/ar-sa.js +4 -0
  11. data/vendor/assets/javascripts/moment/ar-tn.js +55 -0
  12. data/vendor/assets/javascripts/moment/ar.js +4 -0
  13. data/vendor/assets/javascripts/moment/az.js +4 -0
  14. data/vendor/assets/javascripts/moment/be.js +4 -2
  15. data/vendor/assets/javascripts/moment/bn.js +4 -0
  16. data/vendor/assets/javascripts/moment/bo.js +4 -0
  17. data/vendor/assets/javascripts/moment/eo.js +4 -0
  18. data/vendor/assets/javascripts/moment/fa.js +4 -0
  19. data/vendor/assets/javascripts/moment/fy.js +69 -0
  20. data/vendor/assets/javascripts/moment/he.js +2 -0
  21. data/vendor/assets/javascripts/moment/hi.js +15 -0
  22. data/vendor/assets/javascripts/moment/hu.js +4 -0
  23. data/vendor/assets/javascripts/moment/hy-am.js +4 -0
  24. data/vendor/assets/javascripts/moment/id.js +13 -0
  25. data/vendor/assets/javascripts/moment/ja.js +4 -0
  26. data/vendor/assets/javascripts/moment/ko.js +4 -4
  27. data/vendor/assets/javascripts/moment/ml.js +4 -0
  28. data/vendor/assets/javascripts/moment/mr.js +15 -0
  29. data/vendor/assets/javascripts/moment/ms-my.js +13 -0
  30. data/vendor/assets/javascripts/moment/ne.js +15 -0
  31. data/vendor/assets/javascripts/moment/sq.js +4 -0
  32. data/vendor/assets/javascripts/moment/ta.js +29 -13
  33. data/vendor/assets/javascripts/moment/th.js +4 -0
  34. data/vendor/assets/javascripts/moment/uk.js +4 -0
  35. data/vendor/assets/javascripts/moment/zh-cn.js +15 -0
  36. data/vendor/assets/javascripts/moment/zh-tw.js +13 -0
  37. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23c8a02c47169e55915f6947a1a9dd59a9a0e538
4
- data.tar.gz: 78bf924334052c3d41695969560e7dfd821a186c
3
+ metadata.gz: 4b9e9c02dbe78ad6d4eb3239854c963a5f23b725
4
+ data.tar.gz: ada797a9bc2db96877bb52923dbc000a32cfc720
5
5
  SHA512:
6
- metadata.gz: 73e566feb723c94b83c96b05321e06414a10d7c631b558934de9c56400657bf916794ddc11c26f6f203bd11b253f1ee5f8074b0b07149ebd249d37dfce5d5aaa
7
- data.tar.gz: dc5b695098eead50a23a7bed1ea25cc0071f37073f1e8fb7fe98ab927c4f208e2bada5d88246b4e8873e78ea87a265d0021754d37f27a980a07253b1497aa3f3
6
+ metadata.gz: 90ce6f19b0a7a30df26cbb0b3387956364913ee3ca0c919c7f99a28b44a9ee83cf967ae7e4f35ff68c4b2a5f6fdf101cc2757b283a30678e35a09c121960d531
7
+ data.tar.gz: 1fb792d48d16c571baf5aabbb2d666fb8db63a0bdc7e643bd8bf767a17a0e70ec9c9e6d33890cfe433c4369127443a2c58de1475f3722fe78ab3a438a9100976
data/news.md CHANGED
@@ -1,5 +1,8 @@
1
+ ### Version 2.9.0 (2015-01-12)
2
+ - Updated Moment.js to 2.9.0
3
+
1
4
  ### Version 2.8.4 (2015-01-12)
2
- - Updated Moment.js 2.8.4
5
+ - Updated Moment.js to 2.8.4
3
6
 
4
7
  ### Version 2.8.3 (2014-09-11)
5
8
  - Updated Moment.js to 2.8.3
@@ -46,3 +46,16 @@ Started GET "/assets/moment/fr.js" for 127.0.0.1 at 2015-01-12 15:44:26 -0500
46
46
  Served asset /moment/fr.js - 200 OK (1ms)
47
47
  Started GET "/assets/moment.js" for 127.0.0.1 at 2015-01-12 15:44:26 -0500
48
48
  Served asset /moment.js - 200 OK (0ms)
49
+ Started GET "/assets/moment.js" for 127.0.0.1 at 2015-01-12 15:54:20 -0500
50
+ Compiled moment.js (1ms) (pid 23404)
51
+ Served asset /moment.js - 200 OK (12ms)
52
+ Started GET "/assets/moment/fr.js" for 127.0.0.1 at 2015-01-12 15:54:20 -0500
53
+ Served asset /moment/fr.js - 200 OK (1ms)
54
+ Started GET "/assets/moment.js" for 127.0.0.1 at 2015-01-12 15:54:20 -0500
55
+ Served asset /moment.js - 200 OK (0ms)
56
+ Started GET "/assets/moment.js" for 127.0.0.1 at 2015-01-12 15:56:44 -0500
57
+ Served asset /moment.js - 200 OK (3ms)
58
+ Started GET "/assets/moment/fr.js" for 127.0.0.1 at 2015-01-12 15:56:44 -0500
59
+ Served asset /moment/fr.js - 200 OK (1ms)
60
+ Started GET "/assets/moment.js" for 127.0.0.1 at 2015-01-12 15:56:44 -0500
61
+ Served asset /moment.js - 200 OK (0ms)
@@ -8,7 +8,7 @@ class NavigationTest < ActionDispatch::IntegrationTest
8
8
 
9
9
  test 'momentjs response is for the expected version' do
10
10
  get '/assets/moment.js'
11
- assert_match(/VERSION = '2\.8\.4'/, @response.body)
11
+ assert_match(/VERSION = '2\.9\.0'/, @response.body)
12
12
  end
13
13
 
14
14
  test 'can access momentjs translation' do
@@ -1,5 +1,5 @@
1
1
  //! moment.js
2
- //! version : 2.8.4
2
+ //! version : 2.9.0
3
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
4
  //! license : MIT
5
5
  //! momentjs.com
@@ -10,9 +10,9 @@
10
10
  ************************************/
11
11
 
12
12
  var moment,
13
- VERSION = '2.8.4',
13
+ VERSION = '2.9.0',
14
14
  // the global-scope this is NOT the global object in Node.js
15
- globalScope = typeof global !== 'undefined' ? global : this,
15
+ globalScope = (typeof global !== 'undefined' && (typeof window === 'undefined' || window === global.window)) ? global : this,
16
16
  oldGlobalMoment,
17
17
  round = Math.round,
18
18
  hasOwnProperty = Object.prototype.hasOwnProperty,
@@ -89,7 +89,7 @@
89
89
  ['HH', /(T| )\d\d/]
90
90
  ],
91
91
 
92
- // timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-15', '30']
92
+ // timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-', '15', '30']
93
93
  parseTimezoneChunker = /([\+\-]|\d\d)/gi,
94
94
 
95
95
  // getter and setter names
@@ -249,7 +249,7 @@
249
249
  return leftZeroFill(this.milliseconds(), 3);
250
250
  },
251
251
  Z : function () {
252
- var a = -this.zone(),
252
+ var a = this.utcOffset(),
253
253
  b = '+';
254
254
  if (a < 0) {
255
255
  a = -a;
@@ -258,7 +258,7 @@
258
258
  return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2);
259
259
  },
260
260
  ZZ : function () {
261
- var a = -this.zone(),
261
+ var a = this.utcOffset(),
262
262
  b = '+';
263
263
  if (a < 0) {
264
264
  a = -a;
@@ -285,7 +285,9 @@
285
285
 
286
286
  deprecations = {},
287
287
 
288
- lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'];
288
+ lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'],
289
+
290
+ updateInProgress = false;
289
291
 
290
292
  // Pick the first defined of two or three arguments. dfl comes from
291
293
  // default.
@@ -354,6 +356,26 @@
354
356
  };
355
357
  }
356
358
 
359
+ function monthDiff(a, b) {
360
+ // difference in months
361
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
362
+ // b is in (anchor - 1 month, anchor + 1 month)
363
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
364
+ anchor2, adjust;
365
+
366
+ if (b - anchor < 0) {
367
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
368
+ // linear across the month
369
+ adjust = (b - anchor) / (anchor - anchor2);
370
+ } else {
371
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
372
+ // linear across the month
373
+ adjust = (b - anchor) / (anchor2 - anchor);
374
+ }
375
+
376
+ return -(wholeMonthDiff + adjust);
377
+ }
378
+
357
379
  while (ordinalizeTokens.length) {
358
380
  i = ordinalizeTokens.pop();
359
381
  formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i);
@@ -365,6 +387,31 @@
365
387
  formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
366
388
 
367
389
 
390
+ function meridiemFixWrap(locale, hour, meridiem) {
391
+ var isPm;
392
+
393
+ if (meridiem == null) {
394
+ // nothing to do
395
+ return hour;
396
+ }
397
+ if (locale.meridiemHour != null) {
398
+ return locale.meridiemHour(hour, meridiem);
399
+ } else if (locale.isPM != null) {
400
+ // Fallback
401
+ isPm = locale.isPM(meridiem);
402
+ if (isPm && hour < 12) {
403
+ hour += 12;
404
+ }
405
+ if (!isPm && hour === 12) {
406
+ hour = 0;
407
+ }
408
+ return hour;
409
+ } else {
410
+ // thie is not supposed to happen
411
+ return hour;
412
+ }
413
+ }
414
+
368
415
  /************************************
369
416
  Constructors
370
417
  ************************************/
@@ -379,6 +426,13 @@
379
426
  }
380
427
  copyConfig(this, config);
381
428
  this._d = new Date(+config._d);
429
+ // Prevent infinite loop in case updateOffset creates new moment
430
+ // objects.
431
+ if (updateInProgress === false) {
432
+ updateInProgress = true;
433
+ moment.updateOffset(this);
434
+ updateInProgress = false;
435
+ }
382
436
  }
383
437
 
384
438
  // Duration Constructor
@@ -782,7 +836,8 @@
782
836
  return locales[name];
783
837
  }
784
838
 
785
- // Return a moment from input, that is local/utc/zone equivalent to model.
839
+ // Return a moment from input, that is local/utc/utcOffset equivalent to
840
+ // model.
786
841
  function makeAs(input, model) {
787
842
  var res, diff;
788
843
  if (model._isUTC) {
@@ -931,6 +986,7 @@
931
986
  }
932
987
  },
933
988
 
989
+
934
990
  _calendar : {
935
991
  sameDay : '[Today at] LT',
936
992
  nextDay : '[Tomorrow at] LT',
@@ -995,6 +1051,14 @@
995
1051
  doy : 6 // The week that contains Jan 1st is the first week of the year.
996
1052
  },
997
1053
 
1054
+ firstDayOfWeek : function () {
1055
+ return this._week.dow;
1056
+ },
1057
+
1058
+ firstDayOfYear : function () {
1059
+ return this._week.doy;
1060
+ },
1061
+
998
1062
  _invalidDate: 'Invalid date',
999
1063
  invalidDate: function () {
1000
1064
  return this._invalidDate;
@@ -1161,14 +1225,14 @@
1161
1225
  }
1162
1226
  }
1163
1227
 
1164
- function timezoneMinutesFromString(string) {
1228
+ function utcOffsetFromString(string) {
1165
1229
  string = string || '';
1166
1230
  var possibleTzMatches = (string.match(parseTokenTimezone) || []),
1167
1231
  tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [],
1168
1232
  parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0],
1169
1233
  minutes = +(parts[1] * 60) + toInt(parts[2]);
1170
1234
 
1171
- return parts[0] === '+' ? -minutes : minutes;
1235
+ return parts[0] === '+' ? minutes : -minutes;
1172
1236
  }
1173
1237
 
1174
1238
  // function to convert string input to date
@@ -1232,7 +1296,8 @@
1232
1296
  // AM / PM
1233
1297
  case 'a' : // fall through to A
1234
1298
  case 'A' :
1235
- config._isPm = config._locale.isPM(input);
1299
+ config._meridiem = input;
1300
+ // config._isPm = config._locale.isPM(input);
1236
1301
  break;
1237
1302
  // HOUR
1238
1303
  case 'h' : // fall through to hh
@@ -1272,7 +1337,7 @@
1272
1337
  case 'Z' : // fall through to ZZ
1273
1338
  case 'ZZ' :
1274
1339
  config._useUTC = true;
1275
- config._tzm = timezoneMinutesFromString(input);
1340
+ config._tzm = utcOffsetFromString(input);
1276
1341
  break;
1277
1342
  // WEEKDAY - human
1278
1343
  case 'dd':
@@ -1410,10 +1475,10 @@
1410
1475
  }
1411
1476
 
1412
1477
  config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
1413
- // Apply timezone offset from input. The actual zone can be changed
1478
+ // Apply timezone offset from input. The actual utcOffset can be changed
1414
1479
  // with parseZone.
1415
1480
  if (config._tzm != null) {
1416
- config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm);
1481
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
1417
1482
  }
1418
1483
 
1419
1484
  if (config._nextDay) {
@@ -1509,14 +1574,9 @@
1509
1574
  if (config._pf.bigHour === true && config._a[HOUR] <= 12) {
1510
1575
  config._pf.bigHour = undefined;
1511
1576
  }
1512
- // handle am pm
1513
- if (config._isPm && config._a[HOUR] < 12) {
1514
- config._a[HOUR] += 12;
1515
- }
1516
- // if is 12 am, change hours to 0
1517
- if (config._isPm === false && config._a[HOUR] === 12) {
1518
- config._a[HOUR] = 0;
1519
- }
1577
+ // handle meridiem
1578
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],
1579
+ config._meridiem);
1520
1580
  dateFromConfig(config);
1521
1581
  checkOverflow(config);
1522
1582
  }
@@ -1958,6 +2018,8 @@
1958
2018
  s: parseIso(match[7]),
1959
2019
  w: parseIso(match[8])
1960
2020
  };
2021
+ } else if (duration == null) {// checks for null or undefined
2022
+ duration = {};
1961
2023
  } else if (typeof duration === 'object' &&
1962
2024
  ('from' in duration || 'to' in duration)) {
1963
2025
  diffRes = momentsDifference(moment(duration.from), moment(duration.to));
@@ -2122,6 +2184,8 @@
2122
2184
  return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
2123
2185
  };
2124
2186
 
2187
+ moment.isDate = isDate;
2188
+
2125
2189
  /************************************
2126
2190
  Moment Prototype
2127
2191
  ************************************/
@@ -2134,7 +2198,7 @@
2134
2198
  },
2135
2199
 
2136
2200
  valueOf : function () {
2137
- return +this._d + ((this._offset || 0) * 60000);
2201
+ return +this._d - ((this._offset || 0) * 60000);
2138
2202
  },
2139
2203
 
2140
2204
  unix : function () {
@@ -2197,16 +2261,16 @@
2197
2261
  },
2198
2262
 
2199
2263
  utc : function (keepLocalTime) {
2200
- return this.zone(0, keepLocalTime);
2264
+ return this.utcOffset(0, keepLocalTime);
2201
2265
  },
2202
2266
 
2203
2267
  local : function (keepLocalTime) {
2204
2268
  if (this._isUTC) {
2205
- this.zone(0, keepLocalTime);
2269
+ this.utcOffset(0, keepLocalTime);
2206
2270
  this._isUTC = false;
2207
2271
 
2208
2272
  if (keepLocalTime) {
2209
- this.add(this._dateTzOffset(), 'm');
2273
+ this.subtract(this._dateUtcOffset(), 'm');
2210
2274
  }
2211
2275
  }
2212
2276
  return this;
@@ -2223,29 +2287,20 @@
2223
2287
 
2224
2288
  diff : function (input, units, asFloat) {
2225
2289
  var that = makeAs(input, this),
2226
- zoneDiff = (this.zone() - that.zone()) * 6e4,
2227
- diff, output, daysAdjust;
2290
+ zoneDiff = (that.utcOffset() - this.utcOffset()) * 6e4,
2291
+ anchor, diff, output, daysAdjust;
2228
2292
 
2229
2293
  units = normalizeUnits(units);
2230
2294
 
2231
- if (units === 'year' || units === 'month') {
2232
- // average number of days in the months in the given dates
2233
- diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2
2234
- // difference in months
2235
- output = ((this.year() - that.year()) * 12) + (this.month() - that.month());
2236
- // adjust by taking difference in days, average number of days
2237
- // and dst in the given months.
2238
- daysAdjust = (this - moment(this).startOf('month')) -
2239
- (that - moment(that).startOf('month'));
2240
- // same as above but with zones, to negate all dst
2241
- daysAdjust -= ((this.zone() - moment(this).startOf('month').zone()) -
2242
- (that.zone() - moment(that).startOf('month').zone())) * 6e4;
2243
- output += daysAdjust / diff;
2244
- if (units === 'year') {
2295
+ if (units === 'year' || units === 'month' || units === 'quarter') {
2296
+ output = monthDiff(this, that);
2297
+ if (units === 'quarter') {
2298
+ output = output / 3;
2299
+ } else if (units === 'year') {
2245
2300
  output = output / 12;
2246
2301
  }
2247
2302
  } else {
2248
- diff = (this - that);
2303
+ diff = this - that;
2249
2304
  output = units === 'second' ? diff / 1e3 : // 1000
2250
2305
  units === 'minute' ? diff / 6e4 : // 1000 * 60
2251
2306
  units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60
@@ -2266,7 +2321,8 @@
2266
2321
 
2267
2322
  calendar : function (time) {
2268
2323
  // We want to compare the start of today, vs this.
2269
- // Getting start-of-today depends on whether we're zone'd or not.
2324
+ // Getting start-of-today depends on whether we're locat/utc/offset
2325
+ // or not.
2270
2326
  var now = time || moment(),
2271
2327
  sod = makeAs(now, this).startOf('day'),
2272
2328
  diff = this.diff(sod, 'days', true),
@@ -2284,8 +2340,8 @@
2284
2340
  },
2285
2341
 
2286
2342
  isDST : function () {
2287
- return (this.zone() < this.clone().month(0).zone() ||
2288
- this.zone() < this.clone().month(5).zone());
2343
+ return (this.utcOffset() > this.clone().month(0).utcOffset() ||
2344
+ this.utcOffset() > this.clone().month(5).utcOffset());
2289
2345
  },
2290
2346
 
2291
2347
  day : function (input) {
@@ -2375,6 +2431,10 @@
2375
2431
  }
2376
2432
  },
2377
2433
 
2434
+ isBetween: function (from, to, units) {
2435
+ return this.isAfter(from, units) && this.isBefore(to, units);
2436
+ },
2437
+
2378
2438
  isSame: function (input, units) {
2379
2439
  var inputMs;
2380
2440
  units = normalizeUnits(units || 'millisecond');
@@ -2403,9 +2463,27 @@
2403
2463
  }
2404
2464
  ),
2405
2465
 
2466
+ zone : deprecate(
2467
+ 'moment().zone is deprecated, use moment().utcOffset instead. ' +
2468
+ 'https://github.com/moment/moment/issues/1779',
2469
+ function (input, keepLocalTime) {
2470
+ if (input != null) {
2471
+ if (typeof input !== 'string') {
2472
+ input = -input;
2473
+ }
2474
+
2475
+ this.utcOffset(input, keepLocalTime);
2476
+
2477
+ return this;
2478
+ } else {
2479
+ return -this.utcOffset();
2480
+ }
2481
+ }
2482
+ ),
2483
+
2406
2484
  // keepLocalTime = true means only change the timezone, without
2407
- // affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]-->
2408
- // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone
2485
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
2486
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
2409
2487
  // +0200, so we adjust the time as needed, to be valid.
2410
2488
  //
2411
2489
  // Keeping the time actually adds/subtracts (one hour)
@@ -2413,38 +2491,51 @@
2413
2491
  // a second time. In case it wants us to change the offset again
2414
2492
  // _changeInProgress == true case, then we have to adjust, because
2415
2493
  // there is no such time in the given timezone.
2416
- zone : function (input, keepLocalTime) {
2494
+ utcOffset : function (input, keepLocalTime) {
2417
2495
  var offset = this._offset || 0,
2418
2496
  localAdjust;
2419
2497
  if (input != null) {
2420
2498
  if (typeof input === 'string') {
2421
- input = timezoneMinutesFromString(input);
2499
+ input = utcOffsetFromString(input);
2422
2500
  }
2423
2501
  if (Math.abs(input) < 16) {
2424
2502
  input = input * 60;
2425
2503
  }
2426
2504
  if (!this._isUTC && keepLocalTime) {
2427
- localAdjust = this._dateTzOffset();
2505
+ localAdjust = this._dateUtcOffset();
2428
2506
  }
2429
2507
  this._offset = input;
2430
2508
  this._isUTC = true;
2431
2509
  if (localAdjust != null) {
2432
- this.subtract(localAdjust, 'm');
2510
+ this.add(localAdjust, 'm');
2433
2511
  }
2434
2512
  if (offset !== input) {
2435
2513
  if (!keepLocalTime || this._changeInProgress) {
2436
2514
  addOrSubtractDurationFromMoment(this,
2437
- moment.duration(offset - input, 'm'), 1, false);
2515
+ moment.duration(input - offset, 'm'), 1, false);
2438
2516
  } else if (!this._changeInProgress) {
2439
2517
  this._changeInProgress = true;
2440
2518
  moment.updateOffset(this, true);
2441
2519
  this._changeInProgress = null;
2442
2520
  }
2443
2521
  }
2522
+
2523
+ return this;
2444
2524
  } else {
2445
- return this._isUTC ? offset : this._dateTzOffset();
2525
+ return this._isUTC ? offset : this._dateUtcOffset();
2446
2526
  }
2447
- return this;
2527
+ },
2528
+
2529
+ isLocal : function () {
2530
+ return !this._isUTC;
2531
+ },
2532
+
2533
+ isUtcOffset : function () {
2534
+ return this._isUTC;
2535
+ },
2536
+
2537
+ isUtc : function () {
2538
+ return this._isUTC && this._offset === 0;
2448
2539
  },
2449
2540
 
2450
2541
  zoneAbbr : function () {
@@ -2457,9 +2548,9 @@
2457
2548
 
2458
2549
  parseZone : function () {
2459
2550
  if (this._tzm) {
2460
- this.zone(this._tzm);
2551
+ this.utcOffset(this._tzm);
2461
2552
  } else if (typeof this._i === 'string') {
2462
- this.zone(this._i);
2553
+ this.utcOffset(utcOffsetFromString(this._i));
2463
2554
  }
2464
2555
  return this;
2465
2556
  },
@@ -2469,10 +2560,10 @@
2469
2560
  input = 0;
2470
2561
  }
2471
2562
  else {
2472
- input = moment(input).zone();
2563
+ input = moment(input).utcOffset();
2473
2564
  }
2474
2565
 
2475
- return (this.zone() - input) % 60 === 0;
2566
+ return (this.utcOffset() - input) % 60 === 0;
2476
2567
  },
2477
2568
 
2478
2569
  daysInMonth : function () {
@@ -2535,9 +2626,17 @@
2535
2626
  },
2536
2627
 
2537
2628
  set : function (units, value) {
2538
- units = normalizeUnits(units);
2539
- if (typeof this[units] === 'function') {
2540
- this[units](value);
2629
+ var unit;
2630
+ if (typeof units === 'object') {
2631
+ for (unit in units) {
2632
+ this.set(unit, units[unit]);
2633
+ }
2634
+ }
2635
+ else {
2636
+ units = normalizeUnits(units);
2637
+ if (typeof this[units] === 'function') {
2638
+ this[units](value);
2639
+ }
2541
2640
  }
2542
2641
  return this;
2543
2642
  },
@@ -2574,11 +2673,12 @@
2574
2673
  return this._locale;
2575
2674
  },
2576
2675
 
2577
- _dateTzOffset : function () {
2676
+ _dateUtcOffset : function () {
2578
2677
  // On Firefox.24 Date#getTimezoneOffset returns a floating point.
2579
2678
  // https://github.com/moment/moment/pull/1871
2580
- return Math.round(this._d.getTimezoneOffset() / 15) * 15;
2679
+ return -Math.round(this._d.getTimezoneOffset() / 15) * 15;
2581
2680
  }
2681
+
2582
2682
  });
2583
2683
 
2584
2684
  function rawMonthSetter(mom, value) {
@@ -2647,6 +2747,9 @@
2647
2747
  // add aliased format methods
2648
2748
  moment.fn.toJSON = moment.fn.toISOString;
2649
2749
 
2750
+ // alias isUtc for dev-friendliness
2751
+ moment.fn.isUTC = moment.fn.isUtc;
2752
+
2650
2753
  /************************************
2651
2754
  Duration Prototype
2652
2755
  ************************************/
@@ -2834,6 +2937,10 @@
2834
2937
 
2835
2938
  localeData : function () {
2836
2939
  return this._locale;
2940
+ },
2941
+
2942
+ toJSON : function () {
2943
+ return this.toISOString();
2837
2944
  }
2838
2945
  });
2839
2946
 
@@ -2921,7 +3028,7 @@
2921
3028
  if (hasModule) {
2922
3029
  module.exports = moment;
2923
3030
  } else if (typeof define === 'function' && define.amd) {
2924
- define('moment', function (require, exports, module) {
3031
+ define(function (require, exports, module) {
2925
3032
  if (module.config && module.config() && module.config().noGlobal === true) {
2926
3033
  // release the global variable
2927
3034
  globalScope.moment = oldGlobalMoment;
@@ -17,6 +17,10 @@
17
17
  weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
18
18
  weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
19
19
  weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
20
+ meridiemParse: /vm|nm/i,
21
+ isPM : function (input) {
22
+ return /^nm$/i.test(input);
23
+ },
20
24
  meridiem : function (hours, minutes, isLower) {
21
25
  if (hours < 12) {
22
26
  return isLower ? 'vm' : 'VM';
@@ -49,6 +49,10 @@
49
49
  LLL : 'D MMMM YYYY LT',
50
50
  LLLL : 'dddd D MMMM YYYY LT'
51
51
  },
52
+ meridiemParse: /ص|م/,
53
+ isPM : function (input) {
54
+ return 'م' === input;
55
+ },
52
56
  meridiem : function (hour, minute, isLower) {
53
57
  if (hour < 12) {
54
58
  return 'ص';
@@ -0,0 +1,55 @@
1
+ // moment.js locale configuration
2
+ // locale : Tunisian Arabic (ar-tn)
3
+
4
+ (function (factory) {
5
+ if (typeof define === 'function' && define.amd) {
6
+ define(['moment'], factory); // AMD
7
+ } else if (typeof exports === 'object') {
8
+ module.exports = factory(require('../moment')); // Node
9
+ } else {
10
+ factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
11
+ }
12
+ }(function (moment) {
13
+ return moment.defineLocale('ar-tn', {
14
+ months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
15
+ monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
16
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
17
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
18
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
19
+ longDateFormat: {
20
+ LT: 'HH:mm',
21
+ LTS: 'LT:ss',
22
+ L: 'DD/MM/YYYY',
23
+ LL: 'D MMMM YYYY',
24
+ LLL: 'D MMMM YYYY LT',
25
+ LLLL: 'dddd D MMMM YYYY LT'
26
+ },
27
+ calendar: {
28
+ sameDay: '[اليوم على الساعة] LT',
29
+ nextDay: '[غدا على الساعة] LT',
30
+ nextWeek: 'dddd [على الساعة] LT',
31
+ lastDay: '[أمس على الساعة] LT',
32
+ lastWeek: 'dddd [على الساعة] LT',
33
+ sameElse: 'L'
34
+ },
35
+ relativeTime: {
36
+ future: 'في %s',
37
+ past: 'منذ %s',
38
+ s: 'ثوان',
39
+ m: 'دقيقة',
40
+ mm: '%d دقائق',
41
+ h: 'ساعة',
42
+ hh: '%d ساعات',
43
+ d: 'يوم',
44
+ dd: '%d أيام',
45
+ M: 'شهر',
46
+ MM: '%d أشهر',
47
+ y: 'سنة',
48
+ yy: '%d سنوات'
49
+ },
50
+ week: {
51
+ dow: 1, // Monday is the first day of the week.
52
+ doy: 4 // The week that contains Jan 4th is the first week of the year.
53
+ }
54
+ });
55
+ }));
@@ -82,6 +82,10 @@
82
82
  LLL : 'D MMMM YYYY LT',
83
83
  LLLL : 'dddd D MMMM YYYY LT'
84
84
  },
85
+ meridiemParse: /ص|م/,
86
+ isPM : function (input) {
87
+ return 'م' === input;
88
+ },
85
89
  meridiem : function (hour, minute, isLower) {
86
90
  if (hour < 12) {
87
91
  return 'ص';
@@ -73,6 +73,10 @@
73
73
  y : 'bir il',
74
74
  yy : '%d il'
75
75
  },
76
+ meridiemParse: /gecə|səhər|gündüz|axşam/,
77
+ isPM : function (input) {
78
+ return /^(gündüz|axşam)$/.test(input);
79
+ },
76
80
  meridiem : function (hour, minute, isLower) {
77
81
  if (hour < 4) {
78
82
  return 'gecə';
@@ -114,8 +114,10 @@
114
114
  y : 'год',
115
115
  yy : relativeTimeWithPlural
116
116
  },
117
-
118
-
117
+ meridiemParse: /ночы|раніцы|дня|вечара/,
118
+ isPM : function (input) {
119
+ return /^(дня|вечара)$/.test(input);
120
+ },
119
121
  meridiem : function (hour, minute, isLower) {
120
122
  if (hour < 4) {
121
123
  return 'ночы';
@@ -83,6 +83,10 @@
83
83
  return symbolMap[match];
84
84
  });
85
85
  },
86
+ meridiemParse: /রাত|শকাল|দুপুর|বিকেল|রাত/,
87
+ isPM: function (input) {
88
+ return /^(দুপুর|বিকেল|রাত)$/.test(input);
89
+ },
86
90
  //Bengali is a vast language its spoken
87
91
  //in different forms in various parts of the world.
88
92
  //I have just generalized with most common one used
@@ -83,6 +83,10 @@
83
83
  return symbolMap[match];
84
84
  });
85
85
  },
86
+ meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
87
+ isPM: function (input) {
88
+ return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input);
89
+ },
86
90
  meridiem : function (hour, minute, isLower) {
87
91
  if (hour < 4) {
88
92
  return 'མཚན་མོ';
@@ -27,6 +27,10 @@
27
27
  LLL : 'D[-an de] MMMM, YYYY LT',
28
28
  LLLL : 'dddd, [la] D[-an de] MMMM, YYYY LT'
29
29
  },
30
+ meridiemParse: /[ap]\.t\.m/i,
31
+ isPM: function (input) {
32
+ return input.charAt(0).toLowerCase() === 'p';
33
+ },
30
34
  meridiem : function (hours, minutes, isLower) {
31
35
  if (hours > 11) {
32
36
  return isLower ? 'p.t.m.' : 'P.T.M.';
@@ -49,6 +49,10 @@
49
49
  LLL : 'D MMMM YYYY LT',
50
50
  LLLL : 'dddd, D MMMM YYYY LT'
51
51
  },
52
+ meridiemParse: /قبل از ظهر|بعد از ظهر/,
53
+ isPM: function (input) {
54
+ return /بعد از ظهر/.test(input);
55
+ },
52
56
  meridiem : function (hour, minute, isLower) {
53
57
  if (hour < 12) {
54
58
  return 'قبل از ظهر';
@@ -0,0 +1,69 @@
1
+ // moment.js locale configuration
2
+ // locale : frisian (fy)
3
+ // author : Robin van der Vliet : https://github.com/robin0van0der0v
4
+
5
+ (function (factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['moment'], factory); // AMD
8
+ } else if (typeof exports === 'object') {
9
+ module.exports = factory(require('../moment')); // Node
10
+ } else {
11
+ factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
12
+ }
13
+ }(function (moment) {
14
+ var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
15
+ monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
16
+
17
+ return moment.defineLocale('fy', {
18
+ months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
19
+ monthsShort : function (m, format) {
20
+ if (/-MMM-/.test(format)) {
21
+ return monthsShortWithoutDots[m.month()];
22
+ } else {
23
+ return monthsShortWithDots[m.month()];
24
+ }
25
+ },
26
+ weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
27
+ weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
28
+ weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
29
+ longDateFormat : {
30
+ LT : 'HH:mm',
31
+ LTS : 'LT:ss',
32
+ L : 'DD-MM-YYYY',
33
+ LL : 'D MMMM YYYY',
34
+ LLL : 'D MMMM YYYY LT',
35
+ LLLL : 'dddd D MMMM YYYY LT'
36
+ },
37
+ calendar : {
38
+ sameDay: '[hjoed om] LT',
39
+ nextDay: '[moarn om] LT',
40
+ nextWeek: 'dddd [om] LT',
41
+ lastDay: '[juster om] LT',
42
+ lastWeek: '[ôfrûne] dddd [om] LT',
43
+ sameElse: 'L'
44
+ },
45
+ relativeTime : {
46
+ future : 'oer %s',
47
+ past : '%s lyn',
48
+ s : 'in pear sekonden',
49
+ m : 'ien minút',
50
+ mm : '%d minuten',
51
+ h : 'ien oere',
52
+ hh : '%d oeren',
53
+ d : 'ien dei',
54
+ dd : '%d dagen',
55
+ M : 'ien moanne',
56
+ MM : '%d moannen',
57
+ y : 'ien jier',
58
+ yy : '%d jierren'
59
+ },
60
+ ordinalParse: /\d{1,2}(ste|de)/,
61
+ ordinal : function (number) {
62
+ return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
63
+ },
64
+ week : {
65
+ dow : 1, // Monday is the first day of the week.
66
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
67
+ }
68
+ });
69
+ }));
@@ -70,6 +70,8 @@
70
70
  yy : function (number) {
71
71
  if (number === 2) {
72
72
  return 'שנתיים';
73
+ } else if (number % 10 === 0 && number !== 10) {
74
+ return number + ' שנה';
73
75
  }
74
76
  return number + ' שנים';
75
77
  }
@@ -85,6 +85,21 @@
85
85
  },
86
86
  // Hindi notation for meridiems are quite fuzzy in practice. While there exists
87
87
  // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
88
+ meridiemParse: /रात|सुबह|दोपहर|शाम/,
89
+ meridiemHour : function (hour, meridiem) {
90
+ if (hour === 12) {
91
+ hour = 0;
92
+ }
93
+ if (meridiem === 'रात') {
94
+ return hour < 4 ? hour : hour + 12;
95
+ } else if (meridiem === 'सुबह') {
96
+ return hour;
97
+ } else if (meridiem === 'दोपहर') {
98
+ return hour >= 10 ? hour : hour + 12;
99
+ } else if (meridiem === 'शाम') {
100
+ return hour + 12;
101
+ }
102
+ },
88
103
  meridiem : function (hour, minute, isLower) {
89
104
  if (hour < 4) {
90
105
  return 'रात';
@@ -63,6 +63,10 @@
63
63
  LLL : 'YYYY. MMMM D., LT',
64
64
  LLLL : 'YYYY. MMMM D., dddd LT'
65
65
  },
66
+ meridiemParse: /de|du/i,
67
+ isPM: function (input) {
68
+ return input.charAt(1).toLowerCase() === 'u';
69
+ },
66
70
  meridiem : function (hours, minutes, isLower) {
67
71
  if (hours < 12) {
68
72
  return isLower === true ? 'de' : 'DE';
@@ -78,6 +78,10 @@
78
78
  yy : '%d տարի'
79
79
  },
80
80
 
81
+ meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
82
+ isPM: function (input) {
83
+ return /^(ցերեկվա|երեկոյան)$/.test(input);
84
+ },
81
85
  meridiem : function (hour) {
82
86
  if (hour < 4) {
83
87
  return 'գիշերվա';
@@ -26,6 +26,19 @@
26
26
  LLL : 'D MMMM YYYY [pukul] LT',
27
27
  LLLL : 'dddd, D MMMM YYYY [pukul] LT'
28
28
  },
29
+ meridiemParse: /pagi|siang|sore|malam/,
30
+ meridiemHour : function (hour, meridiem) {
31
+ if (hour === 12) {
32
+ hour = 0;
33
+ }
34
+ if (meridiem === 'pagi') {
35
+ return hour;
36
+ } else if (meridiem === 'siang') {
37
+ return hour >= 11 ? hour : hour + 12;
38
+ } else if (meridiem === 'sore' || meridiem === 'malam') {
39
+ return hour + 12;
40
+ }
41
+ },
29
42
  meridiem : function (hours, minutes, isLower) {
30
43
  if (hours < 11) {
31
44
  return 'pagi';
@@ -25,6 +25,10 @@
25
25
  LLL : 'YYYY年M月D日LT',
26
26
  LLLL : 'YYYY年M月D日LT dddd'
27
27
  },
28
+ meridiemParse: /午前|午後/i,
29
+ isPM : function (input) {
30
+ return input === '午後';
31
+ },
28
32
  meridiem : function (hour, minute, isLower) {
29
33
  if (hour < 12) {
30
34
  return '午前';
@@ -28,9 +28,6 @@
28
28
  LLL : 'YYYY년 MMMM D일 LT',
29
29
  LLLL : 'YYYY년 MMMM D일 dddd LT'
30
30
  },
31
- meridiem : function (hour, minute, isUpper) {
32
- return hour < 12 ? '오전' : '오후';
33
- },
34
31
  calendar : {
35
32
  sameDay : '오늘 LT',
36
33
  nextDay : '내일 LT',
@@ -57,9 +54,12 @@
57
54
  },
58
55
  ordinalParse : /\d{1,2}일/,
59
56
  ordinal : '%d일',
60
- meridiemParse : /(오전|오후)/,
57
+ meridiemParse : /오전|오후/,
61
58
  isPM : function (token) {
62
59
  return token === '오후';
60
+ },
61
+ meridiem : function (hour, minute, isUpper) {
62
+ return hour < 12 ? '오전' : '오후';
63
63
  }
64
64
  });
65
65
  }));
@@ -48,6 +48,10 @@
48
48
  y : 'ഒരു വർഷം',
49
49
  yy : '%d വർഷം'
50
50
  },
51
+ meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
52
+ isPM : function (input) {
53
+ return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input);
54
+ },
51
55
  meridiem : function (hour, minute, isLower) {
52
56
  if (hour < 4) {
53
57
  return 'രാത്രി';
@@ -83,6 +83,21 @@
83
83
  return symbolMap[match];
84
84
  });
85
85
  },
86
+ meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
87
+ meridiemHour : function (hour, meridiem) {
88
+ if (hour === 12) {
89
+ hour = 0;
90
+ }
91
+ if (meridiem === 'रात्री') {
92
+ return hour < 4 ? hour : hour + 12;
93
+ } else if (meridiem === 'सकाळी') {
94
+ return hour;
95
+ } else if (meridiem === 'दुपारी') {
96
+ return hour >= 10 ? hour : hour + 12;
97
+ } else if (meridiem === 'सायंकाळी') {
98
+ return hour + 12;
99
+ }
100
+ },
86
101
  meridiem: function (hour, minute, isLower)
87
102
  {
88
103
  if (hour < 4) {
@@ -25,6 +25,19 @@
25
25
  LLL : 'D MMMM YYYY [pukul] LT',
26
26
  LLLL : 'dddd, D MMMM YYYY [pukul] LT'
27
27
  },
28
+ meridiemParse: /pagi|tengahari|petang|malam/,
29
+ meridiemHour: function (hour, meridiem) {
30
+ if (hour === 12) {
31
+ hour = 0;
32
+ }
33
+ if (meridiem === 'pagi') {
34
+ return hour;
35
+ } else if (meridiem === 'tengahari') {
36
+ return hour >= 11 ? hour : hour + 12;
37
+ } else if (meridiem === 'petang' || meridiem === 'malam') {
38
+ return hour + 12;
39
+ }
40
+ },
28
41
  meridiem : function (hours, minutes, isLower) {
29
42
  if (hours < 11) {
30
43
  return 'pagi';
@@ -60,6 +60,21 @@
60
60
  return symbolMap[match];
61
61
  });
62
62
  },
63
+ meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,
64
+ meridiemHour : function (hour, meridiem) {
65
+ if (hour === 12) {
66
+ hour = 0;
67
+ }
68
+ if (meridiem === 'राती') {
69
+ return hour < 3 ? hour : hour + 12;
70
+ } else if (meridiem === 'बिहान') {
71
+ return hour;
72
+ } else if (meridiem === 'दिउँसो') {
73
+ return hour >= 10 ? hour : hour + 12;
74
+ } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') {
75
+ return hour + 12;
76
+ }
77
+ },
63
78
  meridiem : function (hour, minute, isLower) {
64
79
  if (hour < 3) {
65
80
  return 'राती';
@@ -19,6 +19,10 @@
19
19
  weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
20
20
  weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
21
21
  weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
22
+ meridiemParse: /PD|MD/,
23
+ isPM: function (input) {
24
+ return input.charAt(0) === 'M';
25
+ },
22
26
  meridiem : function (hours, minutes, isLower) {
23
27
  return hours < 12 ? 'PD' : 'MD';
24
28
  },
@@ -90,20 +90,36 @@
90
90
 
91
91
 
92
92
  // refer http://ta.wikipedia.org/s/1er1
93
-
93
+ meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
94
94
  meridiem : function (hour, minute, isLower) {
95
- if (hour >= 6 && hour <= 10) {
96
- return ' காலை';
97
- } else if (hour >= 10 && hour <= 14) {
98
- return ' நண்பகல்';
99
- } else if (hour >= 14 && hour <= 18) {
100
- return ' எற்பாடு';
101
- } else if (hour >= 18 && hour <= 20) {
102
- return ' மாலை';
103
- } else if (hour >= 20 && hour <= 24) {
104
- return ' இரவு';
105
- } else if (hour >= 0 && hour <= 6) {
106
- return ' வைகறை';
95
+ if (hour < 2) {
96
+ return ' யாமம்';
97
+ } else if (hour < 6) {
98
+ return ' வைகறை'; // வைகறை
99
+ } else if (hour < 10) {
100
+ return ' காலை'; // காலை
101
+ } else if (hour < 14) {
102
+ return ' நண்பகல்'; // நண்பகல்
103
+ } else if (hour < 18) {
104
+ return ' எற்பாடு'; // எற்பாடு
105
+ } else if (hour < 22) {
106
+ return ' மாலை'; // மாலை
107
+ } else {
108
+ return ' யாமம்';
109
+ }
110
+ },
111
+ meridiemHour : function (hour, meridiem) {
112
+ if (hour === 12) {
113
+ hour = 0;
114
+ }
115
+ if (meridiem === 'யாமம்') {
116
+ return hour < 2 ? hour : hour + 12;
117
+ } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
118
+ return hour;
119
+ } else if (meridiem === 'நண்பகல்') {
120
+ return hour >= 10 ? hour : hour + 12;
121
+ } else {
122
+ return hour + 12;
107
123
  }
108
124
  },
109
125
  week : {
@@ -25,6 +25,10 @@
25
25
  LLL : 'D MMMM YYYY เวลา LT',
26
26
  LLLL : 'วันddddที่ D MMMM YYYY เวลา LT'
27
27
  },
28
+ meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
29
+ isPM: function (input) {
30
+ return input === 'หลังเที่ยง';
31
+ },
28
32
  meridiem : function (hour, minute, isLower) {
29
33
  if (hour < 12) {
30
34
  return 'ก่อนเที่ยง';
@@ -123,6 +123,10 @@
123
123
 
124
124
  // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
125
125
 
126
+ meridiemParse: /ночі|ранку|дня|вечора/,
127
+ isPM: function (input) {
128
+ return /^(дня|вечора)$/.test(input);
129
+ },
126
130
  meridiem : function (hour, minute, isLower) {
127
131
  if (hour < 4) {
128
132
  return 'ночі';
@@ -30,6 +30,21 @@
30
30
  lll : 'YYYY年MMMD日LT',
31
31
  llll : 'YYYY年MMMD日ddddLT'
32
32
  },
33
+ meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
34
+ meridiemHour: function (hour, meridiem) {
35
+ if (hour === 12) {
36
+ hour = 0;
37
+ }
38
+ if (meridiem === '凌晨' || meridiem === '早上' ||
39
+ meridiem === '上午') {
40
+ return hour;
41
+ } else if (meridiem === '下午' || meridiem === '晚上') {
42
+ return hour + 12;
43
+ } else {
44
+ // '中午'
45
+ return hour >= 11 ? hour : hour + 12;
46
+ }
47
+ },
33
48
  meridiem : function (hour, minute, isLower) {
34
49
  var hm = hour * 100 + minute;
35
50
  if (hm < 600) {
@@ -29,6 +29,19 @@
29
29
  lll : 'YYYY年MMMD日LT',
30
30
  llll : 'YYYY年MMMD日ddddLT'
31
31
  },
32
+ meridiemParse: /早上|上午|中午|下午|晚上/,
33
+ meridiemHour : function (hour, meridiem) {
34
+ if (hour === 12) {
35
+ hour = 0;
36
+ }
37
+ if (meridiem === '早上' || meridiem === '上午') {
38
+ return hour;
39
+ } else if (meridiem === '中午') {
40
+ return hour >= 11 ? hour : hour + 12;
41
+ } else if (meridiem === '下午' || meridiem === '晚上') {
42
+ return hour + 12;
43
+ }
44
+ },
32
45
  meridiem : function (hour, minute, isLower) {
33
46
  var hm = hour * 100 + minute;
34
47
  if (hm < 900) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: momentjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.4
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Prior
@@ -80,6 +80,7 @@ files:
80
80
  - vendor/assets/javascripts/moment/af.js
81
81
  - vendor/assets/javascripts/moment/ar-ma.js
82
82
  - vendor/assets/javascripts/moment/ar-sa.js
83
+ - vendor/assets/javascripts/moment/ar-tn.js
83
84
  - vendor/assets/javascripts/moment/ar.js
84
85
  - vendor/assets/javascripts/moment/az.js
85
86
  - vendor/assets/javascripts/moment/be.js
@@ -108,6 +109,7 @@ files:
108
109
  - vendor/assets/javascripts/moment/fo.js
109
110
  - vendor/assets/javascripts/moment/fr-ca.js
110
111
  - vendor/assets/javascripts/moment/fr.js
112
+ - vendor/assets/javascripts/moment/fy.js
111
113
  - vendor/assets/javascripts/moment/gl.js
112
114
  - vendor/assets/javascripts/moment/he.js
113
115
  - vendor/assets/javascripts/moment/hi.js