momentjs-rails 1.7.0 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -24,7 +24,7 @@ If you want to include a localization file, also add the following directive:
24
24
 
25
25
  ## Versioning
26
26
 
27
- momentjs-rails 1.7.0 == Moment.js 1.7.0
27
+ momentjs-rails 1.7.2 == Moment.js 1.7.2
28
28
 
29
29
  Every attempt is made to mirror the currently shipping Momentum.js version number wherever possible.
30
30
  The major, minor, and patch version numbers will always represent the Momentum.js version. Should a gem
data/changelog.md CHANGED
@@ -14,3 +14,7 @@
14
14
  ### Version 1.7.0 (2012-08-06)
15
15
  - Upgrade Moment.js to 1.7.0
16
16
  - Upgrade localization files to 1.7.0 tagged versions.
17
+
18
+ ### Version 1.7.2 (2012-12-17)
19
+ - Upgrade Moment.js to 1.7.2
20
+ - Upgrade localization files to 1.7.2 tagged versions.
@@ -1,17 +1,17 @@
1
1
  // moment.js
2
- // version : 1.7.0
2
+ // version : 1.7.2
3
3
  // author : Tim Wood
4
4
  // license : MIT
5
5
  // momentjs.com
6
6
 
7
- (function (Date, undefined) {
7
+ (function (undefined) {
8
8
 
9
9
  /************************************
10
10
  Constants
11
11
  ************************************/
12
12
 
13
13
  var moment,
14
- VERSION = "1.7.0",
14
+ VERSION = "1.7.2",
15
15
  round = Math.round, i,
16
16
  // internal storage for language config files
17
17
  languages = {},
@@ -30,9 +30,8 @@
30
30
  aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
31
31
 
32
32
  // format tokens
33
- formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g,
34
- localFormattingTokens = /(LT|LL?L?L?)/g,
35
- formattingRemoveEscapes = /(^\[)|(\\)|\]$/g,
33
+ formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|.)/g,
34
+ localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?)/g,
36
35
 
37
36
  // parsing tokens
38
37
  parseMultipleFormatChunker = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,
@@ -46,7 +45,7 @@
46
45
  parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 or Z
47
46
  parseTokenT = /T/i, // T (ISO seperator)
48
47
 
49
- // preliminary iso regex
48
+ // preliminary iso regex
50
49
  // 0000-00-00 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000
51
50
  isoRegex = /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
52
51
  isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',
@@ -77,6 +76,10 @@
77
76
  // format function strings
78
77
  formatFunctions = {},
79
78
 
79
+ // tokens to ordinalize and pad
80
+ ordinalizeTokens = 'DDD w M D d'.split(' '),
81
+ paddedTokens = 'M D H h m s w'.split(' '),
82
+
80
83
  /*
81
84
  * moment.fn.format uses new Function() to create an inlined formatting function.
82
85
  * Results are a 3x speed boost
@@ -84,7 +87,7 @@
84
87
  *
85
88
  * These strings are appended into a function using replaceFormatTokens and makeFormatFunction
86
89
  */
87
- formatFunctionStrings = {
90
+ formatTokenFunctions = {
88
91
  // a = placeholder
89
92
  // b = placeholder
90
93
  // t = the current moment being formatted
@@ -92,43 +95,119 @@
92
95
  // o = language.ordinal function
93
96
  // p = leftZeroFill function
94
97
  // m = language.meridiem value or function
95
- M : '(a=t.month()+1)',
96
- MMM : 'v("monthsShort",t.month())',
97
- MMMM : 'v("months",t.month())',
98
- D : '(a=t.date())',
99
- DDD : '(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))',
100
- d : '(a=t.day())',
101
- dd : 'v("weekdaysMin",t.day())',
102
- ddd : 'v("weekdaysShort",t.day())',
103
- dddd : 'v("weekdays",t.day())',
104
- w : '(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))',
105
- YY : 'p(t.year()%100,2)',
106
- YYYY : 'p(t.year(),4)',
107
- a : 'm(t.hours(),t.minutes(),!0)',
108
- A : 'm(t.hours(),t.minutes(),!1)',
109
- H : 't.hours()',
110
- h : 't.hours()%12||12',
111
- m : 't.minutes()',
112
- s : 't.seconds()',
113
- S : '~~(t.milliseconds()/100)',
114
- SS : 'p(~~(t.milliseconds()/10),2)',
115
- SSS : 'p(t.milliseconds(),3)',
116
- Z : '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)',
117
- ZZ : '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)'
118
- },
98
+ M : function () {
99
+ return this.month() + 1;
100
+ },
101
+ MMM : function (format) {
102
+ return getValueFromArray("monthsShort", this.month(), this, format);
103
+ },
104
+ MMMM : function (format) {
105
+ return getValueFromArray("months", this.month(), this, format);
106
+ },
107
+ D : function () {
108
+ return this.date();
109
+ },
110
+ DDD : function () {
111
+ var a = new Date(this.year(), this.month(), this.date()),
112
+ b = new Date(this.year(), 0, 1);
113
+ return ~~(((a - b) / 864e5) + 1.5);
114
+ },
115
+ d : function () {
116
+ return this.day();
117
+ },
118
+ dd : function (format) {
119
+ return getValueFromArray("weekdaysMin", this.day(), this, format);
120
+ },
121
+ ddd : function (format) {
122
+ return getValueFromArray("weekdaysShort", this.day(), this, format);
123
+ },
124
+ dddd : function (format) {
125
+ return getValueFromArray("weekdays", this.day(), this, format);
126
+ },
127
+ w : function () {
128
+ var a = new Date(this.year(), this.month(), this.date() - this.day() + 5),
129
+ b = new Date(a.getFullYear(), 0, 4);
130
+ return ~~((a - b) / 864e5 / 7 + 1.5);
131
+ },
132
+ YY : function () {
133
+ return leftZeroFill(this.year() % 100, 2);
134
+ },
135
+ YYYY : function () {
136
+ return leftZeroFill(this.year(), 4);
137
+ },
138
+ a : function () {
139
+ return this.lang().meridiem(this.hours(), this.minutes(), true);
140
+ },
141
+ A : function () {
142
+ return this.lang().meridiem(this.hours(), this.minutes(), false);
143
+ },
144
+ H : function () {
145
+ return this.hours();
146
+ },
147
+ h : function () {
148
+ return this.hours() % 12 || 12;
149
+ },
150
+ m : function () {
151
+ return this.minutes();
152
+ },
153
+ s : function () {
154
+ return this.seconds();
155
+ },
156
+ S : function () {
157
+ return ~~(this.milliseconds() / 100);
158
+ },
159
+ SS : function () {
160
+ return leftZeroFill(~~(this.milliseconds() / 10), 2);
161
+ },
162
+ SSS : function () {
163
+ return leftZeroFill(this.milliseconds(), 3);
164
+ },
165
+ Z : function () {
166
+ var a = -this.zone(),
167
+ b = "+";
168
+ if (a < 0) {
169
+ a = -a;
170
+ b = "-";
171
+ }
172
+ return b + leftZeroFill(~~(a / 60), 2) + ":" + leftZeroFill(~~a % 60, 2);
173
+ },
174
+ ZZ : function () {
175
+ var a = -this.zone(),
176
+ b = "+";
177
+ if (a < 0) {
178
+ a = -a;
179
+ b = "-";
180
+ }
181
+ return b + leftZeroFill(~~(10 * a / 6), 4);
182
+ }
183
+ };
119
184
 
120
- ordinalizeTokens = 'DDD w M D d'.split(' '),
121
- paddedTokens = 'M D H h m s w'.split(' ');
185
+ function getValueFromArray(key, index, m, format) {
186
+ var lang = m.lang();
187
+ return lang[key].call ? lang[key](m, format) : lang[key][index];
188
+ }
189
+
190
+ function padToken(func, count) {
191
+ return function (a) {
192
+ return leftZeroFill(func.call(this, a), count);
193
+ };
194
+ }
195
+ function ordinalizeToken(func) {
196
+ return function (a) {
197
+ var b = func.call(this, a);
198
+ return b + this.lang().ordinal(b);
199
+ };
200
+ }
122
201
 
123
202
  while (ordinalizeTokens.length) {
124
203
  i = ordinalizeTokens.pop();
125
- formatFunctionStrings[i + 'o'] = formatFunctionStrings[i] + '+o(a)';
204
+ formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i]);
126
205
  }
127
206
  while (paddedTokens.length) {
128
207
  i = paddedTokens.pop();
129
- formatFunctionStrings[i + i] = 'p(' + formatFunctionStrings[i] + ',2)';
208
+ formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);
130
209
  }
131
- formatFunctionStrings.DDDD = 'p(' + formatFunctionStrings.DDD + ',3)';
210
+ formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
132
211
 
133
212
 
134
213
  /************************************
@@ -141,7 +220,6 @@
141
220
  this._d = date;
142
221
  this._isUTC = !!isUTC;
143
222
  this._a = date._a || null;
144
- date._a = null;
145
223
  this._lang = lang || false;
146
224
  }
147
225
 
@@ -149,7 +227,7 @@
149
227
  function Duration(duration) {
150
228
  var data = this._data = {},
151
229
  years = duration.years || duration.y || 0,
152
- months = duration.months || duration.M || 0,
230
+ months = duration.months || duration.M || 0,
153
231
  weeks = duration.weeks || duration.w || 0,
154
232
  days = duration.days || duration.d || 0,
155
233
  hours = duration.hours || duration.h || 0,
@@ -171,7 +249,7 @@
171
249
  // it separately.
172
250
  this._months = months +
173
251
  years * 12;
174
-
252
+
175
253
  // The following code bubbles up values, see the tests for
176
254
  // examples of what that means.
177
255
  data.milliseconds = milliseconds % 1000;
@@ -188,7 +266,7 @@
188
266
 
189
267
  days += weeks * 7;
190
268
  data.days = days % 30;
191
-
269
+
192
270
  months += absRound(days / 30);
193
271
 
194
272
  data.months = months % 12;
@@ -267,13 +345,21 @@
267
345
  // the array should mirror the parameters below
268
346
  // note: all values past the year are optional and will default to the lowest possible value.
269
347
  // [year, month, day , hour, minute, second, millisecond]
270
- function dateFromArray(input, asUTC) {
271
- var i, date;
272
- for (i = 1; i < 7; i++) {
273
- input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];
348
+ function dateFromArray(input, asUTC, hoursOffset, minutesOffset) {
349
+ var i, date, forValid = [];
350
+ for (i = 0; i < 7; i++) {
351
+ forValid[i] = input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];
274
352
  }
275
353
  // we store whether we used utc or not in the input array
276
- input[7] = asUTC;
354
+ input[7] = forValid[7] = asUTC;
355
+ // if the parser flagged the input as invalid, we pass the value along
356
+ if (input[8] != null) {
357
+ forValid[8] = input[8];
358
+ }
359
+ // add the offsets to the time to be parsed so that we can have a clean array
360
+ // for checking isValid
361
+ input[3] += hoursOffset || 0;
362
+ input[4] += minutesOffset || 0;
277
363
  date = new Date(0);
278
364
  if (asUTC) {
279
365
  date.setUTCFullYear(input[0], input[1], input[2]);
@@ -282,7 +368,7 @@
282
368
  date.setFullYear(input[0], input[1], input[2]);
283
369
  date.setHours(input[3], input[4], input[5], input[6]);
284
370
  }
285
- date._a = input;
371
+ date._a = forValid;
286
372
  return date;
287
373
  }
288
374
 
@@ -297,7 +383,7 @@
297
383
  if (!values && hasModule) {
298
384
  values = require('./lang/' + key);
299
385
  }
300
-
386
+
301
387
  for (i = 0; i < langConfigProperties.length; i++) {
302
388
  // If a language definition does not provide a value, inherit
303
389
  // from English
@@ -307,13 +393,13 @@
307
393
 
308
394
  for (i = 0; i < 12; i++) {
309
395
  m = moment([2000, i]);
310
- parse[i] = new RegExp('^' + (values.months[i] || values.months(m, '')) +
396
+ parse[i] = new RegExp('^' + (values.months[i] || values.months(m, '')) +
311
397
  '|^' + (values.monthsShort[i] || values.monthsShort(m, '')).replace('.', ''), 'i');
312
398
  }
313
399
  values.monthsParse = values.monthsParse || parse;
314
400
 
315
401
  languages[key] = values;
316
-
402
+
317
403
  return values;
318
404
  }
319
405
 
@@ -339,46 +425,42 @@
339
425
  ************************************/
340
426
 
341
427
 
342
- // helper for building inline formatting functions
343
- function replaceFormatTokens(token) {
344
- return formatFunctionStrings[token] ?
345
- ("'+(" + formatFunctionStrings[token] + ")+'") :
346
- token.replace(formattingRemoveEscapes, "").replace(/\\?'/g, "\\'");
347
- }
348
-
349
- // helper for recursing long date formatting tokens
350
- function replaceLongDateFormatTokens(input) {
351
- return getLangDefinition().longDateFormat[input] || input;
428
+ function removeFormattingTokens(input) {
429
+ if (input.match(/\[.*\]/)) {
430
+ return input.replace(/^\[|\]$/g, "");
431
+ }
432
+ return input.replace(/\\/g, "");
352
433
  }
353
434
 
354
435
  function makeFormatFunction(format) {
355
- var output = "var a,b;return '" +
356
- format.replace(formattingTokens, replaceFormatTokens) + "';",
357
- Fn = Function; // get around jshint
358
- // t = the current moment being formatted
359
- // v = getValueAtKey function
360
- // o = language.ordinal function
361
- // p = leftZeroFill function
362
- // m = language.meridiem value or function
363
- return new Fn('t', 'v', 'o', 'p', 'm', output);
364
- }
436
+ var array = format.match(formattingTokens), i, length;
365
437
 
366
- function makeOrGetFormatFunction(format) {
367
- if (!formatFunctions[format]) {
368
- formatFunctions[format] = makeFormatFunction(format);
438
+ for (i = 0, length = array.length; i < length; i++) {
439
+ if (formatTokenFunctions[array[i]]) {
440
+ array[i] = formatTokenFunctions[array[i]];
441
+ } else {
442
+ array[i] = removeFormattingTokens(array[i]);
443
+ }
369
444
  }
370
- return formatFunctions[format];
445
+
446
+ return function (mom) {
447
+ var output = "";
448
+ for (i = 0; i < length; i++) {
449
+ output += typeof array[i].call === 'function' ? array[i].call(mom, format) : array[i];
450
+ }
451
+ return output;
452
+ };
371
453
  }
372
454
 
373
455
  // format date using native date object
374
456
  function formatMoment(m, format) {
375
- var lang = getLangDefinition(m);
457
+ var i = 5;
376
458
 
377
- function getValueFromArray(key, index) {
378
- return lang[key].call ? lang[key](m, format) : lang[key][index];
459
+ function replaceLongDateFormatTokens(input) {
460
+ return m.lang().longDateFormat[input] || input;
379
461
  }
380
462
 
381
- while (localFormattingTokens.test(format)) {
463
+ while (i-- && localFormattingTokens.test(format)) {
382
464
  format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
383
465
  }
384
466
 
@@ -386,7 +468,7 @@
386
468
  formatFunctions[format] = makeFormatFunction(format);
387
469
  }
388
470
 
389
- return formatFunctions[format](m, getValueFromArray, lang.ordinal, leftZeroFill, lang.meridiem);
471
+ return formatFunctions[format](m);
390
472
  }
391
473
 
392
474
 
@@ -442,8 +524,8 @@
442
524
 
443
525
  // function to convert string input to date
444
526
  function addTimeToArrayFromToken(token, input, datePartArray, config) {
445
- var a;
446
- //console.log('addTime', format, input);
527
+ var a, b;
528
+
447
529
  switch (token) {
448
530
  // MONTH
449
531
  case 'M' : // fall through to MM
@@ -455,9 +537,14 @@
455
537
  for (a = 0; a < 12; a++) {
456
538
  if (getLangDefinition().monthsParse[a].test(input)) {
457
539
  datePartArray[1] = a;
540
+ b = true;
458
541
  break;
459
542
  }
460
543
  }
544
+ // if we didn't find a month name, mark the date as invalid.
545
+ if (!b) {
546
+ datePartArray[8] = false;
547
+ }
461
548
  break;
462
549
  // DAY OF MONTH
463
550
  case 'D' : // fall through to DDDD
@@ -470,8 +557,7 @@
470
557
  break;
471
558
  // YEAR
472
559
  case 'YY' :
473
- input = ~~input;
474
- datePartArray[0] = input + (input > 70 ? 1900 : 2000);
560
+ datePartArray[0] = ~~input + (~~input > 70 ? 1900 : 2000);
475
561
  break;
476
562
  case 'YYYY' :
477
563
  datePartArray[0] = ~~Math.abs(input);
@@ -522,10 +608,19 @@
522
608
  }
523
609
  break;
524
610
  }
611
+
612
+ // if the input is null, the date is not valid
613
+ if (input == null) {
614
+ datePartArray[8] = false;
615
+ }
525
616
  }
526
617
 
527
618
  // date from string and format string
528
619
  function makeDateFromStringAndFormat(string, format) {
620
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
621
+ // We store some additional data on the array for validation
622
+ // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`
623
+ // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.
529
624
  var datePartArray = [0, 0, 1, 0, 0, 0, 0],
530
625
  config = {
531
626
  tzh : 0, // timezone hour offset
@@ -536,8 +631,13 @@
536
631
 
537
632
  for (i = 0; i < tokens.length; i++) {
538
633
  parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];
539
- string = string.replace(getParseRegexForToken(tokens[i]), '');
540
- addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);
634
+ if (parsedInput) {
635
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
636
+ }
637
+ // don't parse if its not a known token
638
+ if (formatTokenFunctions[tokens[i]]) {
639
+ addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);
640
+ }
541
641
  }
542
642
  // handle am pm
543
643
  if (config.isPm && datePartArray[3] < 12) {
@@ -547,11 +647,8 @@
547
647
  if (config.isPm === false && datePartArray[3] === 12) {
548
648
  datePartArray[3] = 0;
549
649
  }
550
- // handle timezone
551
- datePartArray[3] += config.tzh;
552
- datePartArray[4] += config.tzm;
553
650
  // return
554
- return dateFromArray(datePartArray, config.isUTC);
651
+ return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);
555
652
  }
556
653
 
557
654
  // date from string and array of format strings
@@ -586,7 +683,7 @@
586
683
  break;
587
684
  }
588
685
  }
589
- return parseTokenTimezone.exec(string) ?
686
+ return parseTokenTimezone.exec(string) ?
590
687
  makeDateFromStringAndFormat(string, format + ' Z') :
591
688
  makeDateFromStringAndFormat(string, format);
592
689
  }
@@ -855,7 +952,12 @@
855
952
 
856
953
  isValid : function () {
857
954
  if (this._a) {
858
- return !compareArrays(this._a, (this._a[7] ? moment.utc(this) : this).toArray());
955
+ // if the parser finds that the input is invalid, it sets
956
+ // the eighth item in the input array to false.
957
+ if (this._a[8] != null) {
958
+ return !!this._a[8];
959
+ }
960
+ return !compareArrays(this._a, (this._a[7] ? moment.utc(this._a) : moment(this._a)).toArray());
859
961
  }
860
962
  return !isNaN(this._d.getTime());
861
963
  },
@@ -936,7 +1038,7 @@
936
1038
  },
937
1039
 
938
1040
  isDST : function () {
939
- return (this.zone() < moment([this.year()]).zone() ||
1041
+ return (this.zone() < moment([this.year()]).zone() ||
940
1042
  this.zone() < moment([this.year(), 5]).zone());
941
1043
  },
942
1044
 
@@ -975,7 +1077,7 @@
975
1077
  endOf: function (val) {
976
1078
  return this.startOf(val).add(val.replace(/s?$/, 's'), 1).subtract('ms', 1);
977
1079
  },
978
-
1080
+
979
1081
  sod: function () {
980
1082
  return this.clone().startOf('day');
981
1083
  },
@@ -1047,10 +1149,15 @@
1047
1149
  humanize : function (withSuffix) {
1048
1150
  var difference = +this,
1049
1151
  rel = this.lang().relativeTime,
1050
- output = relativeTime(difference, !withSuffix, this.lang());
1152
+ output = relativeTime(difference, !withSuffix, this.lang()),
1153
+ fromNow = difference <= 0 ? rel.past : rel.future;
1051
1154
 
1052
1155
  if (withSuffix) {
1053
- output = (difference <= 0 ? rel.past : rel.future).replace(/%s/i, output);
1156
+ if (typeof fromNow === 'function') {
1157
+ output = fromNow(output);
1158
+ } else {
1159
+ output = fromNow.replace(/%s/i, output);
1160
+ }
1054
1161
  }
1055
1162
 
1056
1163
  return output;
@@ -1103,4 +1210,4 @@
1103
1210
  return moment;
1104
1211
  });
1105
1212
  }
1106
- }).call(this, Date);
1213
+ }).call(this);
@@ -24,7 +24,11 @@
24
24
  sameElse: 'L'
25
25
  },
26
26
  relativeTime : {
27
- future : "%sран",
27
+ future : function(output) {
28
+ var affix = /сехет$/i.exec(output)
29
+ ? "рен" : /çул$/i.exec(output) ? "тан" : "ран";
30
+ return output + affix;
31
+ },
28
32
  past : "%s каялла",
29
33
  s : "пĕр-ик çеккунт",
30
34
  m : "пĕр минут",
@@ -53,6 +53,6 @@
53
53
  }
54
54
  // Browser
55
55
  if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
56
- this.moment.lang('en-gb', lang);
56
+ this.moment.lang('en-ca', lang);
57
57
  }
58
58
  }());
@@ -0,0 +1,67 @@
1
+ // moment.js language configuration
2
+ // language : estonian (et)
3
+ // author : Henry Kehlmann : https://github.com/madhenry
4
+ (function () {
5
+
6
+ function translate(number, withoutSuffix, key, isFuture) {
7
+ var num = number;
8
+
9
+ switch (key) {
10
+ case 's':
11
+ return (isFuture || withoutSuffix) ? 'paari sekundi' : 'paar sekundit';
12
+ default:
13
+ }
14
+
15
+ return '';
16
+ }
17
+
18
+ var lang = {
19
+ months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),
20
+ monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),
21
+ weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),
22
+ weekdaysShort : "P_E_T_K_N_R_L".split("_"),
23
+ weekdaysMin : "P_E_T_K_N_R_L".split("_"),
24
+ longDateFormat : {
25
+ LT : "H:mm",
26
+ L : "DD.MM.YYYY",
27
+ LL : "D. MMMM YYYY",
28
+ LLL : "D. MMMM YYYY LT",
29
+ LLLL : "dddd, D. MMMM YYYY LT"
30
+ },
31
+ calendar : {
32
+ sameDay : '[Täna,] LT',
33
+ nextDay : '[Homme,] LT',
34
+ nextWeek : '[Järgmine] dddd LT',
35
+ lastDay : '[Eile,] LT',
36
+ lastWeek : '[Eelmine] dddd LT',
37
+ sameElse : 'L'
38
+ },
39
+ relativeTime : {
40
+ future : "%s pärast",
41
+ past : "%s tagasi",
42
+ s : translate,
43
+ m : "minut",
44
+ mm : "%d minutit",
45
+ h : "tund",
46
+ hh : "%d tundi",
47
+ d : "päev",
48
+ dd : "%d päeva",
49
+ M : "kuu",
50
+ MM : "%d kuud",
51
+ y : "aasta",
52
+ yy : "%d aastat"
53
+ },
54
+ ordinal : function (number) {
55
+ return '.';
56
+ }
57
+ };
58
+
59
+ // Node
60
+ if (typeof module !== 'undefined' && module.exports) {
61
+ module.exports = lang;
62
+ }
63
+ // Browser
64
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
65
+ this.moment.lang('et', lang);
66
+ }
67
+ }());
@@ -49,6 +49,6 @@
49
49
  }
50
50
  // Browser
51
51
  if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
52
- this.moment.lang('fr', lang);
52
+ this.moment.lang('fr-ca', lang);
53
53
  }
54
54
  }());
@@ -3,7 +3,7 @@
3
3
  // author : Lorenzo : https://github.com/aliem
4
4
  (function () {
5
5
  var lang = {
6
- months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),
6
+ months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"),
7
7
  monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),
8
8
  weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),
9
9
  weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),
@@ -0,0 +1,55 @@
1
+ // moment.js language configuration
2
+ // language : romanian (ro)
3
+ // author : Vlad Gurdiga : https://github.com/gurdiga
4
+ // author : Valentin Agachi : https://github.com/avaly
5
+ (function () {
6
+ var lang = {
7
+ months : "Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),
8
+ monthsShort : "Ian_Feb_Mar_Apr_Mai_Iun_Iul_Aug_Sep_Oct_Noi_Dec".split("_"),
9
+ weekdays : "Duminică_Luni_Marţi_Miercuri_Joi_Vineri_Sâmbătă".split("_"),
10
+ weekdaysShort : "Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),
11
+ weekdaysMin : "Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),
12
+ longDateFormat : {
13
+ LT : "H:mm",
14
+ L : "DD/MM/YYYY",
15
+ LL : "D MMMM YYYY",
16
+ LLL : "D MMMM YYYY H:mm",
17
+ LLLL : "dddd, D MMMM YYYY H:mm"
18
+ },
19
+ calendar : {
20
+ sameDay: "[azi la] LT",
21
+ nextDay: '[mâine la] LT',
22
+ nextWeek: 'dddd [la] LT',
23
+ lastDay: '[ieri la] LT',
24
+ lastWeek: '[fosta] dddd [la] LT',
25
+ sameElse: 'L'
26
+ },
27
+ relativeTime : {
28
+ future : "peste %s",
29
+ past : "%s în urmă",
30
+ s : "câteva secunde",
31
+ m : "un minut",
32
+ mm : "%d minute",
33
+ h : "o oră",
34
+ hh : "%d ore",
35
+ d : "o zi",
36
+ dd : "%d zile",
37
+ M : "o lună",
38
+ MM : "%d luni",
39
+ y : "un an",
40
+ yy : "%d ani"
41
+ },
42
+ ordinal : function (number) {
43
+ return '';
44
+ }
45
+ };
46
+
47
+ // Node
48
+ if (typeof module !== 'undefined') {
49
+ module.exports = lang;
50
+ }
51
+ // Browser
52
+ if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
53
+ this.moment.lang('ro', lang);
54
+ }
55
+ }());
@@ -55,7 +55,7 @@
55
55
  weekdaysCaseReplace = function (m, format) {
56
56
  var weekdays = {
57
57
  'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
58
- 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
58
+ 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')
59
59
  },
60
60
 
61
61
  nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ?
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: momentjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 0
10
- version: 1.7.0
9
+ - 2
10
+ version: 1.7.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Derek Prior
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-08-06 00:00:00 -04:00
18
+ date: 2012-12-16 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -51,6 +51,7 @@ files:
51
51
  - vendor/assets/javascripts/moment/en-ca.js
52
52
  - vendor/assets/javascripts/moment/en-gb.js
53
53
  - vendor/assets/javascripts/moment/es.js
54
+ - vendor/assets/javascripts/moment/et.js
54
55
  - vendor/assets/javascripts/moment/eu.js
55
56
  - vendor/assets/javascripts/moment/fi.js
56
57
  - vendor/assets/javascripts/moment/fr-ca.js
@@ -68,6 +69,7 @@ files:
68
69
  - vendor/assets/javascripts/moment/pl.js
69
70
  - vendor/assets/javascripts/moment/pt-br.js
70
71
  - vendor/assets/javascripts/moment/pt.js
72
+ - vendor/assets/javascripts/moment/ro.js
71
73
  - vendor/assets/javascripts/moment/ru.js
72
74
  - vendor/assets/javascripts/moment/sv.js
73
75
  - vendor/assets/javascripts/moment/tr.js