From: Iskren Chernev Date: Sun, 22 Mar 2015 22:00:07 +0000 (-0700) Subject: Replace double with single quotes X-Git-Tag: 2.10.2~15^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6928b84f9244c5be300dce4d41709c3da83e6661;p=thirdparty%2Fmoment.git Replace double with single quotes --- diff --git a/src/lib/create/check-overflow.js b/src/lib/create/check-overflow.js index 92c96593f..7ee7556f8 100644 --- a/src/lib/create/check-overflow.js +++ b/src/lib/create/check-overflow.js @@ -1,5 +1,5 @@ -import { daysInMonth } from "../units/month"; -import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from "../units/constants"; +import { daysInMonth } from '../units/month'; +import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants'; export default function checkOverflow (m) { var overflow; diff --git a/src/lib/create/from-anything.js b/src/lib/create/from-anything.js index 44b0103ec..a5a59f359 100644 --- a/src/lib/create/from-anything.js +++ b/src/lib/create/from-anything.js @@ -1,18 +1,18 @@ -import defaultParsingFlags from "./default-parsing-flags"; -import isArray from "../utils/is-array"; -import isDate from "../utils/is-date"; -import map from "../utils/map"; -import { createInvalid } from "./valid"; -import { Moment, isMoment } from "../moment/constructor"; -import { getLocale } from "../locale/locales"; -import { hooks } from "../utils/hooks"; -import checkOverflow from "./check-overflow"; +import defaultParsingFlags from './default-parsing-flags'; +import isArray from '../utils/is-array'; +import isDate from '../utils/is-date'; +import map from '../utils/map'; +import { createInvalid } from './valid'; +import { Moment, isMoment } from '../moment/constructor'; +import { getLocale } from '../locale/locales'; +import { hooks } from '../utils/hooks'; +import checkOverflow from './check-overflow'; -import { configFromStringAndArray } from "./from-string-and-array"; -import { configFromStringAndFormat } from "./from-string-and-format"; -import { configFromString } from "./from-string"; -import { configFromArray } from "./from-array"; -import { configFromObject } from "./from-object"; +import { configFromStringAndArray } from './from-string-and-array'; +import { configFromStringAndFormat } from './from-string-and-format'; +import { configFromString } from './from-string'; +import { configFromArray } from './from-array'; +import { configFromObject } from './from-object'; function createFromConfig (config) { var input = config._i, diff --git a/src/lib/create/from-array.js b/src/lib/create/from-array.js index 63b810aa9..51da52fd2 100644 --- a/src/lib/create/from-array.js +++ b/src/lib/create/from-array.js @@ -1,10 +1,10 @@ -import { createDate, createUTCDate } from "./date-from-array"; -import { daysInYear } from "../units/year"; -import { weekOfYear } from "../units/week"; -import { dayOfYearFromWeeks } from "../units/day-of-year"; -import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from "../units/constants"; -import { createLocal } from "./local"; -import defaults from "../utils/defaults"; +import { createDate, createUTCDate } from './date-from-array'; +import { daysInYear } from '../units/year'; +import { weekOfYear } from '../units/week'; +import { dayOfYearFromWeeks } from '../units/day-of-year'; +import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants'; +import { createLocal } from './local'; +import defaults from '../utils/defaults'; function currentDateArray(config) { var now = new Date(); diff --git a/src/lib/create/from-object.js b/src/lib/create/from-object.js index 56189c344..af8e082f4 100644 --- a/src/lib/create/from-object.js +++ b/src/lib/create/from-object.js @@ -1,5 +1,5 @@ -import { normalizeObjectUnits } from "../units/aliases"; -import { configFromArray } from "./from-array"; +import { normalizeObjectUnits } from '../units/aliases'; +import { configFromArray } from './from-array'; export function configFromObject(config) { if (config._d) { diff --git a/src/lib/create/from-string-and-array.js b/src/lib/create/from-string-and-array.js index 8576b41a5..e44af67fb 100644 --- a/src/lib/create/from-string-and-array.js +++ b/src/lib/create/from-string-and-array.js @@ -1,8 +1,8 @@ -import { copyConfig } from "../moment/constructor"; -import { configFromStringAndFormat } from "./from-string-and-format"; -import defaultParsingFlags from "./default-parsing-flags"; -import { isValid } from "./valid"; -import extend from "../utils/extend"; +import { copyConfig } from '../moment/constructor'; +import { configFromStringAndFormat } from './from-string-and-format'; +import defaultParsingFlags from './default-parsing-flags'; +import { isValid } from './valid'; +import extend from '../utils/extend'; // date from string and array of format strings export function configFromStringAndArray(config) { diff --git a/src/lib/create/from-string-and-format.js b/src/lib/create/from-string-and-format.js index fccf9d68f..8a75873a0 100644 --- a/src/lib/create/from-string-and-format.js +++ b/src/lib/create/from-string-and-format.js @@ -1,11 +1,11 @@ -import { configFromISO } from "./from-string"; -import { configFromArray } from "./from-array"; -import { getParseRegexForToken } from "../parse/regex"; -import { addTimeToArrayFromToken } from "../parse/token"; -import { expandFormat, formatTokenFunctions, formattingTokens } from "../format/format"; -import checkOverflow from "./check-overflow"; -import { HOUR } from "../units/constants"; -import { hooks } from "../utils/hooks"; +import { configFromISO } from './from-string'; +import { configFromArray } from './from-array'; +import { getParseRegexForToken } from '../parse/regex'; +import { addTimeToArrayFromToken } from '../parse/token'; +import { expandFormat, formatTokenFunctions, formattingTokens } from '../format/format'; +import checkOverflow from './check-overflow'; +import { HOUR } from '../units/constants'; +import { hooks } from '../utils/hooks'; // constant that refers to the ISO standard hooks.ISO_8601 = function () {}; diff --git a/src/lib/create/from-string.js b/src/lib/create/from-string.js index 8353100cc..052d3be38 100644 --- a/src/lib/create/from-string.js +++ b/src/lib/create/from-string.js @@ -1,7 +1,7 @@ -import { matchOffset } from "../parse/regex"; -import { configFromStringAndFormat } from "./from-string-and-format"; -import { hooks } from "../utils/hooks"; -import { deprecate } from "../utils/deprecate"; +import { matchOffset } from '../parse/regex'; +import { configFromStringAndFormat } from './from-string-and-format'; +import { hooks } from '../utils/hooks'; +import { deprecate } from '../utils/deprecate'; // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) diff --git a/src/lib/create/local.js b/src/lib/create/local.js index 4d0da5498..88c1e2692 100644 --- a/src/lib/create/local.js +++ b/src/lib/create/local.js @@ -1,4 +1,4 @@ -import { createLocalOrUTC } from "./from-anything"; +import { createLocalOrUTC } from './from-anything'; export function createLocal (input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); diff --git a/src/lib/create/utc.js b/src/lib/create/utc.js index f35e3a069..96139530e 100644 --- a/src/lib/create/utc.js +++ b/src/lib/create/utc.js @@ -1,4 +1,4 @@ -import { createLocalOrUTC } from "./from-anything"; +import { createLocalOrUTC } from './from-anything'; export function createUTC (input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); diff --git a/src/lib/create/valid.js b/src/lib/create/valid.js index 292b00f39..a5aaba008 100644 --- a/src/lib/create/valid.js +++ b/src/lib/create/valid.js @@ -1,5 +1,5 @@ -import extend from "../utils/extend"; -import { createUTC } from "./utc"; +import extend from '../utils/extend'; +import { createUTC } from './utc'; export function isValid(m) { if (m._isValid == null) { diff --git a/src/lib/duration/add-subtract.js b/src/lib/duration/add-subtract.js index 20c68f239..3b44e186f 100644 --- a/src/lib/duration/add-subtract.js +++ b/src/lib/duration/add-subtract.js @@ -1,4 +1,4 @@ -import { createDuration } from "./create"; +import { createDuration } from './create'; function addSubtract (duration, input, value, direction) { var other = createDuration(input, value); diff --git a/src/lib/duration/as.js b/src/lib/duration/as.js index 7fb5f62f5..aa9731d0f 100644 --- a/src/lib/duration/as.js +++ b/src/lib/duration/as.js @@ -1,6 +1,6 @@ -import { daysToYears, yearsToDays } from "./bubble"; -import { normalizeUnits } from "../units/aliases"; -import toInt from "../utils/to-int"; +import { daysToYears, yearsToDays } from './bubble'; +import { normalizeUnits } from '../units/aliases'; +import toInt from '../utils/to-int'; export function as (units) { var days; @@ -9,22 +9,22 @@ export function as (units) { units = normalizeUnits(units); - if (units === "month" || units === "year") { + if (units === 'month' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToYears(days) * 12; - return units === "month" ? months : months / 12; + return units === 'month' ? months : months / 12; } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(yearsToDays(this._months / 12)); switch (units) { - case "week" : return days / 7 + milliseconds / 6048e5; - case "day" : return days + milliseconds / 864e5; - case "hour" : return days * 24 + milliseconds / 36e5; - case "minute" : return days * 24 * 60 + milliseconds / 6e4; - case "second" : return days * 24 * 60 * 60 + milliseconds / 1000; + case 'week' : return days / 7 + milliseconds / 6048e5; + case 'day' : return days + milliseconds / 864e5; + case 'hour' : return days * 24 + milliseconds / 36e5; + case 'minute' : return days * 24 * 60 + milliseconds / 6e4; + case 'second' : return days * 24 * 60 * 60 + milliseconds / 1000; // Math.floor prevents floating point math errors here - case "millisecond": return Math.floor(days * 24 * 60 * 60 * 1000) + milliseconds; - default: throw new Error("Unknown unit " + units); + case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + milliseconds; + default: throw new Error('Unknown unit ' + units); } } } @@ -45,11 +45,11 @@ function makeAs (alias) { }; } -export var asMilliseconds = makeAs("ms"); -export var asSeconds = makeAs("s"); -export var asMinutes = makeAs("m"); -export var asHours = makeAs("h"); -export var asDays = makeAs("d"); -export var asWeeks = makeAs("w"); -export var asMonths = makeAs("M"); -export var asYears = makeAs("y"); +export var asMilliseconds = makeAs('ms'); +export var asSeconds = makeAs('s'); +export var asMinutes = makeAs('m'); +export var asHours = makeAs('h'); +export var asDays = makeAs('d'); +export var asWeeks = makeAs('w'); +export var asMonths = makeAs('M'); +export var asYears = makeAs('y'); diff --git a/src/lib/duration/bubble.js b/src/lib/duration/bubble.js index d85ee25b8..3dae6b249 100644 --- a/src/lib/duration/bubble.js +++ b/src/lib/duration/bubble.js @@ -1,4 +1,4 @@ -import absFloor from "../utils/abs-floor"; +import absFloor from '../utils/abs-floor'; export function bubble () { var milliseconds = this._milliseconds; diff --git a/src/lib/duration/constructor.js b/src/lib/duration/constructor.js index ef605d916..884c6f8c8 100644 --- a/src/lib/duration/constructor.js +++ b/src/lib/duration/constructor.js @@ -1,5 +1,5 @@ -import { normalizeObjectUnits } from "../units/aliases"; -import { getLocale } from "../locale/locales"; +import { normalizeObjectUnits } from '../units/aliases'; +import { getLocale } from '../locale/locales'; export function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), diff --git a/src/lib/duration/create.js b/src/lib/duration/create.js index 1050d3553..c7a326aa1 100644 --- a/src/lib/duration/create.js +++ b/src/lib/duration/create.js @@ -1,9 +1,9 @@ -import { Duration, isDuration } from "./constructor"; -import toInt from "../utils/to-int"; -import hasOwnProp from "../utils/has-own-prop"; -import { DATE, HOUR, MINUTE, SECOND, MILLISECOND } from "../units/constants"; -import { cloneWithOffset } from "../units/offset"; -import { createLocal } from "../create/local"; +import { Duration, isDuration } from './constructor'; +import toInt from '../utils/to-int'; +import hasOwnProp from '../utils/has-own-prop'; +import { DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants'; +import { cloneWithOffset } from '../units/offset'; +import { createLocal } from '../create/local'; // ASP.NET json date format regex var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; diff --git a/src/lib/duration/duration.js b/src/lib/duration/duration.js index 50324872e..24440bb2b 100644 --- a/src/lib/duration/duration.js +++ b/src/lib/duration/duration.js @@ -1,9 +1,9 @@ // Side effect imports -import "./prototype"; +import './prototype'; -import { createDuration } from "./create"; -import { isDuration } from "./constructor"; -import { getSetRelativeTimeThreshold } from "./humanize"; +import { createDuration } from './create'; +import { isDuration } from './constructor'; +import { getSetRelativeTimeThreshold } from './humanize'; export { createDuration, diff --git a/src/lib/duration/get.js b/src/lib/duration/get.js index 68d4d2edf..6dafacdd8 100644 --- a/src/lib/duration/get.js +++ b/src/lib/duration/get.js @@ -1,5 +1,5 @@ -import { normalizeUnits } from "../units/aliases"; -import absFloor from "../utils/abs-floor"; +import { normalizeUnits } from '../units/aliases'; +import absFloor from '../utils/abs-floor'; export function get (units) { units = normalizeUnits(units); diff --git a/src/lib/duration/humanize.js b/src/lib/duration/humanize.js index c7903f145..d6dd83b04 100644 --- a/src/lib/duration/humanize.js +++ b/src/lib/duration/humanize.js @@ -1,4 +1,4 @@ -import { createDuration } from "./create"; +import { createDuration } from './create'; var round = Math.round; var thresholds = { diff --git a/src/lib/duration/prototype.js b/src/lib/duration/prototype.js index f07105eaf..0257ff9b5 100644 --- a/src/lib/duration/prototype.js +++ b/src/lib/duration/prototype.js @@ -1,15 +1,15 @@ -import { Duration } from "./constructor"; +import { Duration } from './constructor'; var proto = Duration.prototype; -import { abs } from "./abs"; -import { add, subtract } from "./add-subtract"; -import { as, asMilliseconds, asSeconds, asMinutes, asHours, asDays, asWeeks, asMonths, asYears, valueOf } from "./as"; -import { bubble } from "./bubble"; -import { get, milliseconds, seconds, minutes, hours, days, months, years, weeks } from "./get"; -import { humanize } from "./humanize"; -import { toISOString } from "./iso-string"; -import { lang, locale, localeData } from "../moment/locale"; +import { abs } from './abs'; +import { add, subtract } from './add-subtract'; +import { as, asMilliseconds, asSeconds, asMinutes, asHours, asDays, asWeeks, asMonths, asYears, valueOf } from './as'; +import { bubble } from './bubble'; +import { get, milliseconds, seconds, minutes, hours, days, months, years, weeks } from './get'; +import { humanize } from './humanize'; +import { toISOString } from './iso-string'; +import { lang, locale, localeData } from '../moment/locale'; proto.abs = abs; proto.add = add; @@ -42,7 +42,7 @@ proto.locale = locale; proto.localeData = localeData; // Deprecations -import { deprecate } from "../utils/deprecate"; +import { deprecate } from '../utils/deprecate'; proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString); proto.lang = lang; diff --git a/src/lib/format/format.js b/src/lib/format/format.js index 402c971f8..565da01e2 100644 --- a/src/lib/format/format.js +++ b/src/lib/format/format.js @@ -1,4 +1,4 @@ -import zeroFill from "../utils/zero-fill"; +import zeroFill from '../utils/zero-fill'; export var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g; @@ -8,13 +8,13 @@ var formatFunctions = {}; export var formatTokenFunctions = {}; -// token: "M" -// padded: ["MM", 2] -// ordinal: "Mo" +// token: 'M' +// padded: ['MM', 2] +// ordinal: 'Mo' // callback: function () { this.month() + 1 } export function addFormatToken (token, padded, ordinal, callback) { var func = callback; - if (typeof callback === "string") { + if (typeof callback === 'string') { func = function () { return this[callback](); }; diff --git a/src/lib/locale/en.js b/src/lib/locale/en.js index bbd76228d..20964cd9c 100644 --- a/src/lib/locale/en.js +++ b/src/lib/locale/en.js @@ -1,6 +1,6 @@ -import "./prototype"; -import { getSetGlobalLocale } from "./locales"; -import toInt from "../utils/to-int"; +import './prototype'; +import { getSetGlobalLocale } from './locales'; +import toInt from '../utils/to-int'; getSetGlobalLocale('en', { ordinalParse: /\d{1,2}(th|st|nd|rd)/, diff --git a/src/lib/locale/lists.js b/src/lib/locale/lists.js index c45901d49..ea0161ab9 100644 --- a/src/lib/locale/lists.js +++ b/src/lib/locale/lists.js @@ -1,5 +1,5 @@ -import { getLocale } from "./locales"; -import { createUTC } from "../create/utc"; +import { getLocale } from './locales'; +import { createUTC } from '../create/utc'; function get (format, index, field, setter) { var locale = getLocale(); @@ -28,21 +28,21 @@ function list (format, index, field, count, setter) { } export function listMonths (format, index) { - return list(format, index, "months", 12, "month"); + return list(format, index, 'months', 12, 'month'); } export function listMonthsShort (format, index) { - return list(format, index, "monthsShort", 12, "month"); + return list(format, index, 'monthsShort', 12, 'month'); } export function listWeekdays (format, index) { - return list(format, index, "weekdays", 7, "day"); + return list(format, index, 'weekdays', 7, 'day'); } export function listWeekdaysShort (format, index) { - return list(format, index, "weekdaysShort", 7, "day"); + return list(format, index, 'weekdaysShort', 7, 'day'); } export function listWeekdaysMin (format, index) { - return list(format, index, "weekdaysMin", 7, "day"); + return list(format, index, 'weekdaysMin', 7, 'day'); } diff --git a/src/lib/locale/locale.js b/src/lib/locale/locale.js index 170c86750..2fc3c46ff 100644 --- a/src/lib/locale/locale.js +++ b/src/lib/locale/locale.js @@ -1,11 +1,11 @@ // Side effect imports -import "./prototype"; +import './prototype'; import { getSetGlobalLocale, defineLocale, getLocale -} from "./locales"; +} from './locales'; import { listMonths, @@ -13,7 +13,7 @@ import { listWeekdays, listWeekdaysShort, listWeekdaysMin -} from "./lists"; +} from './lists'; export { getSetGlobalLocale, @@ -26,10 +26,10 @@ export { listWeekdaysMin }; -import { deprecate } from "../utils/deprecate"; -import { hooks } from "../utils/hooks"; +import { deprecate } from '../utils/deprecate'; +import { hooks } from '../utils/hooks'; hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); -import "./en"; +import './en'; diff --git a/src/lib/locale/locales.js b/src/lib/locale/locales.js index 5f8c90fb6..f213ea4d0 100644 --- a/src/lib/locale/locales.js +++ b/src/lib/locale/locales.js @@ -1,6 +1,6 @@ -import isArray from "../utils/is-array"; -import compareArrays from "../utils/compare-arrays"; -import { Locale } from "./constructor"; +import isArray from '../utils/is-array'; +import compareArrays from '../utils/compare-arrays'; +import { Locale } from './constructor'; // internal storage for locale config files var locales = {}; diff --git a/src/lib/locale/prototype.js b/src/lib/locale/prototype.js index ddc8241cb..ed02d4f3b 100644 --- a/src/lib/locale/prototype.js +++ b/src/lib/locale/prototype.js @@ -1,14 +1,14 @@ -import { Locale } from "./constructor"; +import { Locale } from './constructor'; var proto = Locale.prototype; -import { defaultCalendar, calendar } from "./calendar"; -import { defaultLongDateFormat, longDateFormat } from "./formats"; -import { defaultInvalidDate, invalidDate } from "./invalid"; -import { defaultOrdinal, ordinal, defaultOrdinalParse } from "./ordinal"; -import { preParsePostFormat } from "./pre-post-format"; -import { defaultRelativeTime, relativeTime, pastFuture } from "./relative"; -import { set } from "./set"; +import { defaultCalendar, calendar } from './calendar'; +import { defaultLongDateFormat, longDateFormat } from './formats'; +import { defaultInvalidDate, invalidDate } from './invalid'; +import { defaultOrdinal, ordinal, defaultOrdinalParse } from './ordinal'; +import { preParsePostFormat } from './pre-post-format'; +import { defaultRelativeTime, relativeTime, pastFuture } from './relative'; +import { set } from './set'; proto._calendar = defaultCalendar; proto.calendar = calendar; @@ -31,7 +31,7 @@ import { localeMonthsParse, defaultLocaleMonths, localeMonths, defaultLocaleMonthsShort, localeMonthsShort -} from "../units/month"; +} from '../units/month'; proto.months = localeMonths; proto._months = defaultLocaleMonths; @@ -40,7 +40,7 @@ proto._monthsShort = defaultLocaleMonthsShort; proto.monthsParse = localeMonthsParse; // Week -import { localeWeek, defaultLocaleWeek, localeFirstDayOfYear, localeFirstDayOfWeek } from "../units/week"; +import { localeWeek, defaultLocaleWeek, localeFirstDayOfYear, localeFirstDayOfWeek } from '../units/week'; proto.week = localeWeek; proto._week = defaultLocaleWeek; proto.firstDayOfYear = localeFirstDayOfYear; @@ -52,7 +52,7 @@ import { defaultLocaleWeekdays, localeWeekdays, defaultLocaleWeekdaysMin, localeWeekdaysMin, defaultLocaleWeekdaysShort, localeWeekdaysShort -} from "../units/day-of-week"; +} from '../units/day-of-week'; proto.weekdays = localeWeekdays; proto._weekdays = defaultLocaleWeekdays; @@ -63,7 +63,7 @@ proto._weekdaysShort = defaultLocaleWeekdaysShort; proto.weekdaysParse = localeWeekdaysParse; // Hours -import { localeIsPM, defaultLocaleMeridiemParse, localeMeridiem } from "../units/hour"; +import { localeIsPM, defaultLocaleMeridiemParse, localeMeridiem } from '../units/hour'; proto.isPM = localeIsPM; proto._meridiemParse = defaultLocaleMeridiemParse; diff --git a/src/lib/moment/add-subtract.js b/src/lib/moment/add-subtract.js index 50adf8a3b..3c10c5738 100644 --- a/src/lib/moment/add-subtract.js +++ b/src/lib/moment/add-subtract.js @@ -1,8 +1,8 @@ -import { get, set } from "./get-set"; -import { setMonth } from "../units/month"; -import { createDuration } from "../duration/create"; -import { deprecateSimple } from "../utils/deprecate"; -import { hooks } from "../utils/hooks"; +import { get, set } from './get-set'; +import { setMonth } from '../units/month'; +import { createDuration } from '../duration/create'; +import { deprecateSimple } from '../utils/deprecate'; +import { hooks } from '../utils/hooks'; // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { diff --git a/src/lib/moment/calendar.js b/src/lib/moment/calendar.js index 50c82b5a6..66d70adcc 100644 --- a/src/lib/moment/calendar.js +++ b/src/lib/moment/calendar.js @@ -1,5 +1,5 @@ -import { createLocal } from "../create/local"; -import { cloneWithOffset } from "../units/offset"; +import { createLocal } from '../create/local'; +import { cloneWithOffset } from '../units/offset'; export function calendar (time) { // We want to compare the start of today, vs this. diff --git a/src/lib/moment/clone.js b/src/lib/moment/clone.js index fb3141e8c..d96b328b2 100644 --- a/src/lib/moment/clone.js +++ b/src/lib/moment/clone.js @@ -1,4 +1,4 @@ -import { Moment } from "./constructor"; +import { Moment } from './constructor'; export function clone () { return new Moment(this); diff --git a/src/lib/moment/compare.js b/src/lib/moment/compare.js index 75d164be4..b6634737a 100644 --- a/src/lib/moment/compare.js +++ b/src/lib/moment/compare.js @@ -1,6 +1,6 @@ -import { isMoment } from "./constructor"; -import { normalizeUnits } from "../units/aliases"; -import { createLocal } from "../create/local"; +import { isMoment } from './constructor'; +import { normalizeUnits } from '../units/aliases'; +import { createLocal } from '../create/local'; export function isAfter (input, units) { var inputMs; diff --git a/src/lib/moment/constructor.js b/src/lib/moment/constructor.js index 61686edc6..2376cae70 100644 --- a/src/lib/moment/constructor.js +++ b/src/lib/moment/constructor.js @@ -1,5 +1,5 @@ -import { hooks } from "../utils/hooks"; -import hasOwnProp from "../utils/has-own-prop"; +import { hooks } from '../utils/hooks'; +import hasOwnProp from '../utils/has-own-prop'; // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. diff --git a/src/lib/moment/diff.js b/src/lib/moment/diff.js index 9177b315c..2c16d1dc7 100644 --- a/src/lib/moment/diff.js +++ b/src/lib/moment/diff.js @@ -1,6 +1,6 @@ -import absFloor from "../utils/abs-floor"; -import { cloneWithOffset } from "../units/offset"; -import { normalizeUnits } from "../units/aliases"; +import absFloor from '../utils/abs-floor'; +import { cloneWithOffset } from '../units/offset'; +import { normalizeUnits } from '../units/aliases'; export function diff (input, units, asFloat) { var that = cloneWithOffset(input, this), diff --git a/src/lib/moment/format.js b/src/lib/moment/format.js index 0855a6a43..4939f389d 100644 --- a/src/lib/moment/format.js +++ b/src/lib/moment/format.js @@ -1,5 +1,5 @@ -import { formatMoment } from "../format/format"; -import { hooks } from "../utils/hooks"; +import { formatMoment } from '../format/format'; +import { hooks } from '../utils/hooks'; hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; diff --git a/src/lib/moment/from.js b/src/lib/moment/from.js index 116fe2046..0044eede0 100644 --- a/src/lib/moment/from.js +++ b/src/lib/moment/from.js @@ -1,5 +1,5 @@ -import { createDuration } from "../duration/create"; -import { createLocal } from "../create/local"; +import { createDuration } from '../duration/create'; +import { createLocal } from '../create/local'; export function from (time, withoutSuffix) { return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); diff --git a/src/lib/moment/get-set.js b/src/lib/moment/get-set.js index b91b13bc4..0f2be6045 100644 --- a/src/lib/moment/get-set.js +++ b/src/lib/moment/get-set.js @@ -1,5 +1,5 @@ -import { normalizeUnits } from "../units/aliases"; -import { hooks } from "../utils/hooks"; +import { normalizeUnits } from '../units/aliases'; +import { hooks } from '../utils/hooks'; export function makeGetSet (unit, keepTime) { return function (value) { diff --git a/src/lib/moment/locale.js b/src/lib/moment/locale.js index aa8e58846..fb46e6569 100644 --- a/src/lib/moment/locale.js +++ b/src/lib/moment/locale.js @@ -1,5 +1,5 @@ -import { getLocale } from "../locale/locales"; -import { deprecate } from "../utils/deprecate"; +import { getLocale } from '../locale/locales'; +import { deprecate } from '../utils/deprecate'; // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration diff --git a/src/lib/moment/min-max.js b/src/lib/moment/min-max.js index 7e0d658c3..c4a88d24e 100644 --- a/src/lib/moment/min-max.js +++ b/src/lib/moment/min-max.js @@ -1,6 +1,6 @@ -import { deprecate } from "../utils/deprecate"; -import isArray from "../utils/is-array"; -import { createLocal } from "../create/local"; +import { deprecate } from '../utils/deprecate'; +import isArray from '../utils/is-array'; +import { createLocal } from '../create/local'; export var prototypeMin = deprecate( 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', diff --git a/src/lib/moment/moment.js b/src/lib/moment/moment.js index c692569c6..cf73b9f71 100644 --- a/src/lib/moment/moment.js +++ b/src/lib/moment/moment.js @@ -1,9 +1,9 @@ -import { createLocal } from "../create/local"; -import { createUTC } from "../create/utc"; -import { createInvalid } from "../create/valid"; -import { isMoment } from "./constructor"; -import { min, max } from "./min-max"; -import momentPrototype from "./prototype"; +import { createLocal } from '../create/local'; +import { createUTC } from '../create/utc'; +import { createInvalid } from '../create/valid'; +import { isMoment } from './constructor'; +import { min, max } from './min-max'; +import momentPrototype from './prototype'; function createUnix (input) { return createLocal(input * 1000); diff --git a/src/lib/moment/prototype.js b/src/lib/moment/prototype.js index 0c656377a..b31b80e77 100644 --- a/src/lib/moment/prototype.js +++ b/src/lib/moment/prototype.js @@ -1,20 +1,20 @@ -import { Moment } from "./constructor"; +import { Moment } from './constructor'; var proto = Moment.prototype; -import { add, subtract } from "./add-subtract"; -import { calendar } from "./calendar"; -import { clone } from "./clone"; -import { isBefore, isBetween, isSame, isAfter } from "./compare"; -import { diff } from "./diff"; -import { format, toString, toISOString } from "./format"; -import { from, fromNow } from "./from"; -import { getSet } from "./get-set"; -import { locale, localeData, lang } from "./locale"; -import { prototypeMin, prototypeMax } from "./min-max"; -import { startOf, endOf } from "./start-end-of"; -import { valueOf, toDate, toArray, unix } from "./to-type"; -import { isValid, parsingFlags, invalidAt } from "./valid"; +import { add, subtract } from './add-subtract'; +import { calendar } from './calendar'; +import { clone } from './clone'; +import { isBefore, isBetween, isSame, isAfter } from './compare'; +import { diff } from './diff'; +import { format, toString, toISOString } from './format'; +import { from, fromNow } from './from'; +import { getSet } from './get-set'; +import { locale, localeData, lang } from './locale'; +import { prototypeMin, prototypeMax } from './min-max'; +import { startOf, endOf } from './start-end-of'; +import { valueOf, toDate, toArray, unix } from './to-type'; +import { isValid, parsingFlags, invalidAt } from './valid'; proto.add = add; proto.calendar = calendar; @@ -49,35 +49,35 @@ proto.unix = unix; proto.valueOf = valueOf; // Year -import { getSetYear, getIsLeapYear } from "../units/year"; +import { getSetYear, getIsLeapYear } from '../units/year'; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; // Week Year -import { getSetWeekYear, getSetISOWeekYear, getWeeksInYear, getISOWeeksInYear } from "../units/week-year"; +import { getSetWeekYear, getSetISOWeekYear, getWeeksInYear, getISOWeeksInYear } from '../units/week-year'; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; // Quarter -import { getSetQuarter } from "../units/quarter"; +import { getSetQuarter } from '../units/quarter'; proto.quarter = proto.quarters = getSetQuarter; // Month -import { getSetMonth, getDaysInMonth } from "../units/month"; +import { getSetMonth, getDaysInMonth } from '../units/month'; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; // Week -import { getSetWeek, getSetISOWeek } from "../units/week"; +import { getSetWeek, getSetISOWeek } from '../units/week'; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.isoWeeksInYear = getISOWeeksInYear; // Day -import { getSetDayOfMonth } from "../units/day-of-month"; -import { getSetDayOfWeek, getSetISODayOfWeek, getSetLocaleDayOfWeek } from "../units/day-of-week"; -import { getSetDayOfYear } from "../units/day-of-year"; +import { getSetDayOfMonth } from '../units/day-of-month'; +import { getSetDayOfWeek, getSetISODayOfWeek, getSetLocaleDayOfWeek } from '../units/day-of-week'; +import { getSetDayOfYear } from '../units/day-of-year'; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; @@ -85,19 +85,19 @@ proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; // Hour -import { getSetHour } from "../units/hour"; +import { getSetHour } from '../units/hour'; proto.hour = proto.hours = getSetHour; // Minute -import { getSetMinute } from "../units/minute"; +import { getSetMinute } from '../units/minute'; proto.minute = proto.minutes = getSetMinute; // Second -import { getSetSecond } from "../units/second"; +import { getSetSecond } from '../units/second'; proto.second = proto.seconds = getSetSecond; // Millisecond -import { getSetMillisecond } from "../units/millisecond"; +import { getSetMillisecond } from '../units/millisecond'; proto.millisecond = proto.milliseconds = getSetMillisecond; // Offset @@ -113,7 +113,7 @@ import { isLocal, isUtcOffset, isUtc -} from "../units/offset"; +} from '../units/offset'; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; @@ -127,12 +127,12 @@ proto.isUtc = isUtc; proto.isUTC = isUtc; // Timezone -import { getZoneAbbr, getZoneName } from "../units/timezone"; +import { getZoneAbbr, getZoneName } from '../units/timezone'; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; // Deprecations -import { deprecate } from "../utils/deprecate"; +import { deprecate } from '../utils/deprecate'; proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); diff --git a/src/lib/moment/start-end-of.js b/src/lib/moment/start-end-of.js index 4434d6bda..6b56b627f 100644 --- a/src/lib/moment/start-end-of.js +++ b/src/lib/moment/start-end-of.js @@ -1,4 +1,4 @@ -import { normalizeUnits } from "../units/aliases"; +import { normalizeUnits } from '../units/aliases'; export function startOf (units) { units = normalizeUnits(units); diff --git a/src/lib/moment/valid.js b/src/lib/moment/valid.js index afbf54be1..ffd47de8e 100644 --- a/src/lib/moment/valid.js +++ b/src/lib/moment/valid.js @@ -1,5 +1,5 @@ -import { isValid as _isValid } from "../create/valid"; -import extend from "../utils/extend"; +import { isValid as _isValid } from '../create/valid'; +import extend from '../utils/extend'; export function isValid () { return _isValid(this); diff --git a/src/lib/parse/regex.js b/src/lib/parse/regex.js index 6074d4c55..23091a083 100644 --- a/src/lib/parse/regex.js +++ b/src/lib/parse/regex.js @@ -18,12 +18,12 @@ export var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. export var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; -import hasOwnProp from "../utils/has-own-prop"; +import hasOwnProp from '../utils/has-own-prop'; var regexes = {}; export function addRegexToken (token, regex, strictRegex) { - regexes[token] = typeof regex === "function" ? regex : function (isStrict) { + regexes[token] = typeof regex === 'function' ? regex : function (isStrict) { return (isStrict && strictRegex) ? strictRegex : regex; }; } diff --git a/src/lib/parse/token.js b/src/lib/parse/token.js index b476cc8a2..781b9cf3a 100644 --- a/src/lib/parse/token.js +++ b/src/lib/parse/token.js @@ -1,14 +1,14 @@ -import hasOwnProp from "../utils/has-own-prop"; -import toInt from "../utils/to-int"; +import hasOwnProp from '../utils/has-own-prop'; +import toInt from '../utils/to-int'; var tokens = {}; export function addParseToken (token, callback) { var i, func = callback; - if (typeof token === "string") { + if (typeof token === 'string') { token = [token]; } - if (typeof callback === "number") { + if (typeof callback === 'number') { func = function (input, array) { array[callback] = toInt(input); }; diff --git a/src/lib/units/aliases.js b/src/lib/units/aliases.js index b73332a03..4ad513384 100644 --- a/src/lib/units/aliases.js +++ b/src/lib/units/aliases.js @@ -1,4 +1,4 @@ -import hasOwnProp from "../utils/has-own-prop"; +import hasOwnProp from '../utils/has-own-prop'; var aliases = {}; @@ -8,7 +8,7 @@ export function addUnitAlias (unit, shorthand) { } export function normalizeUnits(units) { - return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : undefined; + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } export function normalizeObjectUnits(inputObject) { diff --git a/src/lib/units/day-of-month.js b/src/lib/units/day-of-month.js index bc50abee2..dc32acc24 100644 --- a/src/lib/units/day-of-month.js +++ b/src/lib/units/day-of-month.js @@ -1,29 +1,29 @@ -import { makeGetSet } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match2 } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { DATE } from "./constants"; -import toInt from "../utils/to-int"; +import { makeGetSet } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match2 } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { DATE } from './constants'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken("D", ["DD", 2], "Do", "date"); +addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES -addUnitAlias("date", "D"); +addUnitAlias('date', 'D'); // PARSING -addRegexToken("D", match1to2); -addRegexToken("DD", match1to2, match2); -addRegexToken("Do", function (isStrict, locale) { +addRegexToken('D', match1to2); +addRegexToken('DD', match1to2, match2); +addRegexToken('Do', function (isStrict, locale) { return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; }); -addParseToken(["D", "DD"], DATE); -addParseToken("Do", function (input, array) { +addParseToken(['D', 'DD'], DATE); +addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0], 10); }); diff --git a/src/lib/units/day-of-week.js b/src/lib/units/day-of-week.js index 7cef2f86e..c1cf95273 100644 --- a/src/lib/units/day-of-week.js +++ b/src/lib/units/day-of-week.js @@ -1,45 +1,45 @@ -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, matchWord } from "../parse/regex"; -import { addWeekParseToken } from "../parse/token"; -import toInt from "../utils/to-int"; -import { createLocal } from "../create/local"; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, matchWord } from '../parse/regex'; +import { addWeekParseToken } from '../parse/token'; +import toInt from '../utils/to-int'; +import { createLocal } from '../create/local'; // FORMATTING -addFormatToken("d", 0, "do", "day"); +addFormatToken('d', 0, 'do', 'day'); -addFormatToken("dd", 0, 0, function (format) { +addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); -addFormatToken("ddd", 0, 0, function (format) { +addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); -addFormatToken("dddd", 0, 0, function (format) { +addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); -addFormatToken("e", 0, 0, "weekday"); -addFormatToken("E", 0, 0, "isoWeekday"); +addFormatToken('e', 0, 0, 'weekday'); +addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES -addUnitAlias("day", "d"); -addUnitAlias("weekday", "e"); -addUnitAlias("isoWeekday", "E"); +addUnitAlias('day', 'd'); +addUnitAlias('weekday', 'e'); +addUnitAlias('isoWeekday', 'E'); // PARSING -addRegexToken("d", match1to2); -addRegexToken("e", match1to2); -addRegexToken("E", match1to2); -addRegexToken("dd", matchWord); -addRegexToken("ddd", matchWord); -addRegexToken("dddd", matchWord); +addRegexToken('d', match1to2); +addRegexToken('e', match1to2); +addRegexToken('E', match1to2); +addRegexToken('dd', matchWord); +addRegexToken('ddd', matchWord); +addRegexToken('dddd', matchWord); -addWeekParseToken(["dd", "ddd", "dddd"], function (input, week, config) { +addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { var weekday = config._locale.weekdaysParse(input); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { @@ -49,7 +49,7 @@ addWeekParseToken(["dd", "ddd", "dddd"], function (input, week, config) { } }); -addWeekParseToken(["d", "e", "E"], function (input, week, config, token) { +addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); diff --git a/src/lib/units/day-of-year.js b/src/lib/units/day-of-year.js index eef2d68b0..7c4d2860b 100644 --- a/src/lib/units/day-of-year.js +++ b/src/lib/units/day-of-year.js @@ -1,24 +1,24 @@ -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match3, match1to3 } from "../parse/regex"; -import { daysInYear } from "./year"; -import { createUTCDate } from "../create/date-from-array"; -import { addParseToken } from "../parse/token"; -import toInt from "../utils/to-int"; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match3, match1to3 } from '../parse/regex'; +import { daysInYear } from './year'; +import { createUTCDate } from '../create/date-from-array'; +import { addParseToken } from '../parse/token'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear"); +addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES -addUnitAlias("dayOfYear", "DDD"); +addUnitAlias('dayOfYear', 'DDD'); // PARSING -addRegexToken("DDD", match1to3); -addRegexToken("DDDD", match3); -addParseToken(["DDD", "DDDD"], function (input, array, config) { +addRegexToken('DDD', match1to3); +addRegexToken('DDDD', match3); +addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); diff --git a/src/lib/units/hour.js b/src/lib/units/hour.js index 0b926ee49..c2e7eb22f 100644 --- a/src/lib/units/hour.js +++ b/src/lib/units/hour.js @@ -1,15 +1,15 @@ -import { makeGetSet } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match2 } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { HOUR } from "./constants"; -import toInt from "../utils/to-int"; +import { makeGetSet } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match2 } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { HOUR } from './constants'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken("H", ["HH", 2], 0, "hour"); -addFormatToken("h", ["hh", 2], 0, function () { +addFormatToken('H', ['HH', 2], 0, 'hour'); +addFormatToken('h', ['hh', 2], 0, function () { return this.hours() % 12 || 12; }); @@ -24,7 +24,7 @@ meridiem('A', false); // ALIASES -addUnitAlias("hour", "h"); +addUnitAlias('hour', 'h'); // PARSING @@ -32,19 +32,19 @@ function matchMeridiem (isStrict, locale) { return locale._meridiemParse; } -addRegexToken("a", matchMeridiem); -addRegexToken("A", matchMeridiem); -addRegexToken("H", match1to2); -addRegexToken("h", match1to2); -addRegexToken("HH", match1to2, match2); -addRegexToken("hh", match1to2, match2); +addRegexToken('a', matchMeridiem); +addRegexToken('A', matchMeridiem); +addRegexToken('H', match1to2); +addRegexToken('h', match1to2); +addRegexToken('HH', match1to2, match2); +addRegexToken('hh', match1to2, match2); -addParseToken(["H", "HH"], HOUR); -addParseToken(["a", "A"], function (input, array, config) { +addParseToken(['H', 'HH'], HOUR); +addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); -addParseToken(["h", "hh"], function (input, array, config) { +addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); config._pf.bigHour = true; }); diff --git a/src/lib/units/millisecond.js b/src/lib/units/millisecond.js index 3e9c3793d..2fb73af08 100644 --- a/src/lib/units/millisecond.js +++ b/src/lib/units/millisecond.js @@ -1,39 +1,39 @@ -import { makeGetSet } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1, match2, match3, match1to3, matchUnsigned } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { MILLISECOND } from "./constants"; -import toInt from "../utils/to-int"; +import { makeGetSet } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1, match2, match3, match1to3, matchUnsigned } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { MILLISECOND } from './constants'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken("S", 0, 0, function () { +addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); -addFormatToken(0, ["SS", 2], 0, function () { +addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); function milliseconds (token) { - addFormatToken(0, [token, 3], 0, "millisecond"); + addFormatToken(0, [token, 3], 0, 'millisecond'); } -milliseconds("SSS"); -milliseconds("SSSS"); +milliseconds('SSS'); +milliseconds('SSSS'); // ALIASES -addUnitAlias("millisecond", "ms"); +addUnitAlias('millisecond', 'ms'); // PARSING -addRegexToken("S", match1to3, match1); -addRegexToken("SS", match1to3, match2); -addRegexToken("SSS", match1to3, match3); -addRegexToken("SSSS", matchUnsigned); -addParseToken(["S", "SS", "SSS", "SSSS"], function (input, array) { +addRegexToken('S', match1to3, match1); +addRegexToken('SS', match1to3, match2); +addRegexToken('SSS', match1to3, match3); +addRegexToken('SSSS', matchUnsigned); +addParseToken(['S', 'SS', 'SSS', 'SSSS'], function (input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); }); diff --git a/src/lib/units/minute.js b/src/lib/units/minute.js index dfea040c2..e9473b863 100644 --- a/src/lib/units/minute.js +++ b/src/lib/units/minute.js @@ -1,23 +1,23 @@ -import { makeGetSet } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match2 } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { MINUTE } from "./constants"; +import { makeGetSet } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match2 } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { MINUTE } from './constants'; // FORMATTING -addFormatToken("m", ["mm", 2], 0, "minute"); +addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES -addUnitAlias("minute", "m"); +addUnitAlias('minute', 'm'); // PARSING -addRegexToken("m", match1to2); -addRegexToken("mm", match1to2, match2); -addParseToken(["m", "mm"], MINUTE); +addRegexToken('m', match1to2); +addRegexToken('mm', match1to2, match2); +addParseToken(['m', 'mm'], MINUTE); // MOMENTS diff --git a/src/lib/units/month.js b/src/lib/units/month.js index d59eb35af..3c3213714 100644 --- a/src/lib/units/month.js +++ b/src/lib/units/month.js @@ -1,12 +1,12 @@ -import { get } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match2, matchWord } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { hooks } from "../utils/hooks"; -import { MONTH } from "./constants"; -import toInt from "../utils/to-int"; -import { createUTC } from "../create/utc"; +import { get } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match2, matchWord } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { hooks } from '../utils/hooks'; +import { MONTH } from './constants'; +import toInt from '../utils/to-int'; +import { createUTC } from '../create/utc'; export function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -14,34 +14,34 @@ export function daysInMonth(year, month) { // FORMATTING -addFormatToken("M", ["MM", 2], "Mo", function () { +addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); -addFormatToken("MMM", 0, 0, function (format) { +addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); -addFormatToken("MMMM", 0, 0, function (format) { +addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // ALIASES -addUnitAlias("month", "M"); +addUnitAlias('month', 'M'); // PARSING -addRegexToken("M", match1to2); -addRegexToken("MM", match1to2, match2); -addRegexToken("MMM", matchWord); -addRegexToken("MMMM", matchWord); +addRegexToken('M', match1to2); +addRegexToken('MM', match1to2, match2); +addRegexToken('MMM', matchWord); +addRegexToken('MMMM', matchWord); -addParseToken(["M", "MM"], function (input, array) { +addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); -addParseToken(["MMM", "MMMM"], function (input, array, config, token) { +addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { @@ -119,7 +119,7 @@ export function getSetMonth (value) { hooks.updateOffset(this, true); return this; } else { - return get(this, "Month"); + return get(this, 'Month'); } } diff --git a/src/lib/units/offset.js b/src/lib/units/offset.js index 4b720d9b6..75aeb0211 100644 --- a/src/lib/units/offset.js +++ b/src/lib/units/offset.js @@ -1,16 +1,16 @@ -import zeroFill from "../utils/zero-fill"; -import { createDuration } from "../duration/create"; -import { addSubtract } from "../moment/add-subtract"; -import { isMoment } from "../moment/constructor"; -import { addFormatToken } from "../format/format"; -import { addRegexToken, matchOffset } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { createLocal } from "../create/local"; -import { createUTC } from "../create/utc"; -import isDate from "../utils/is-date"; -import toInt from "../utils/to-int"; -import compareArrays from "../utils/compare-arrays"; -import { hooks } from "../utils/hooks"; +import zeroFill from '../utils/zero-fill'; +import { createDuration } from '../duration/create'; +import { addSubtract } from '../moment/add-subtract'; +import { isMoment } from '../moment/constructor'; +import { addFormatToken } from '../format/format'; +import { addRegexToken, matchOffset } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { createLocal } from '../create/local'; +import { createUTC } from '../create/utc'; +import isDate from '../utils/is-date'; +import toInt from '../utils/to-int'; +import compareArrays from '../utils/compare-arrays'; +import { hooks } from '../utils/hooks'; // FORMATTING @@ -26,14 +26,14 @@ function offset (token, separator) { }); } -offset("Z", ":"); -offset("ZZ", ""); +offset('Z', ':'); +offset('ZZ', ''); // PARSING -addRegexToken("Z", matchOffset); -addRegexToken("ZZ", matchOffset); -addParseToken(["Z", "ZZ"], function (input, array, config) { +addRegexToken('Z', matchOffset); +addRegexToken('ZZ', matchOffset); +addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(input); }); @@ -46,7 +46,7 @@ addParseToken(["Z", "ZZ"], function (input, array, config) { var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(string) { - var matches = ((string || "").match(matchOffset) || []); + var matches = ((string || '').match(matchOffset) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); diff --git a/src/lib/units/quarter.js b/src/lib/units/quarter.js index c0dc4214b..d383f561e 100644 --- a/src/lib/units/quarter.js +++ b/src/lib/units/quarter.js @@ -1,22 +1,22 @@ -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1 } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { MONTH } from "./constants"; -import toInt from "../utils/to-int"; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1 } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { MONTH } from './constants'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken("Q", 0, 0, "quarter"); +addFormatToken('Q', 0, 0, 'quarter'); // ALIASES -addUnitAlias("quarter", "Q"); +addUnitAlias('quarter', 'Q'); // PARSING -addRegexToken("Q", match1); -addParseToken("Q", function (input, array) { +addRegexToken('Q', match1); +addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); diff --git a/src/lib/units/second.js b/src/lib/units/second.js index 8eaa35a7b..118fe3083 100644 --- a/src/lib/units/second.js +++ b/src/lib/units/second.js @@ -1,23 +1,23 @@ -import { makeGetSet } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match2 } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { SECOND } from "./constants"; +import { makeGetSet } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match2 } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { SECOND } from './constants'; // FORMATTING -addFormatToken("s", ["ss", 2], 0, "second"); +addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES -addUnitAlias("second", "s"); +addUnitAlias('second', 's'); // PARSING -addRegexToken("s", match1to2); -addRegexToken("ss", match1to2, match2); -addParseToken(["s", "ss"], SECOND); +addRegexToken('s', match1to2); +addRegexToken('ss', match1to2, match2); +addParseToken(['s', 'ss'], SECOND); // MOMENTS diff --git a/src/lib/units/timestamp.js b/src/lib/units/timestamp.js index bbe54b115..a49e1e4b8 100644 --- a/src/lib/units/timestamp.js +++ b/src/lib/units/timestamp.js @@ -1,20 +1,20 @@ -import { addFormatToken } from "../format/format"; -import { addRegexToken, matchTimestamp, matchSigned } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import toInt from "../utils/to-int"; +import { addFormatToken } from '../format/format'; +import { addRegexToken, matchTimestamp, matchSigned } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken("X", 0, 0, "unix"); -addFormatToken("x", 0, 0, "valueOf"); +addFormatToken('X', 0, 0, 'unix'); +addFormatToken('x', 0, 0, 'valueOf'); // PARSING -addRegexToken("x", matchSigned); -addRegexToken("X", matchTimestamp); -addParseToken("X", function (input, array, config) { +addRegexToken('x', matchSigned); +addRegexToken('X', matchTimestamp); +addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input, 10) * 1000); }); -addParseToken("x", function (input, array, config) { +addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); diff --git a/src/lib/units/timezone.js b/src/lib/units/timezone.js index b8b3c82f9..20c81cd2c 100644 --- a/src/lib/units/timezone.js +++ b/src/lib/units/timezone.js @@ -1,9 +1,9 @@ -import { addFormatToken } from "../format/format"; +import { addFormatToken } from '../format/format'; // FORMATTING -addFormatToken("z", 0, 0, "zoneAbbr"); -addFormatToken("zz", 0, 0, "zoneName"); +addFormatToken('z', 0, 0, 'zoneAbbr'); +addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS diff --git a/src/lib/units/units.js b/src/lib/units/units.js index ded65f70d..6f45f1c04 100644 --- a/src/lib/units/units.js +++ b/src/lib/units/units.js @@ -1,20 +1,20 @@ // Side effect imports -import "./day-of-month"; -import "./day-of-week"; -import "./day-of-year"; -import "./hour"; -import "./millisecond"; -import "./minute"; -import "./month"; -import "./offset"; -import "./quarter"; -import "./second"; -import "./timestamp"; -import "./timezone"; -import "./week-year"; -import "./week"; -import "./year"; +import './day-of-month'; +import './day-of-week'; +import './day-of-year'; +import './hour'; +import './millisecond'; +import './minute'; +import './month'; +import './offset'; +import './quarter'; +import './second'; +import './timestamp'; +import './timezone'; +import './week-year'; +import './week'; +import './year'; -import { normalizeUnits } from "./aliases"; +import { normalizeUnits } from './aliases'; export { normalizeUnits }; diff --git a/src/lib/units/week-year.js b/src/lib/units/week-year.js index 78735210b..8ecfce754 100644 --- a/src/lib/units/week-year.js +++ b/src/lib/units/week-year.js @@ -1,19 +1,19 @@ -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from "../parse/regex"; -import { addWeekParseToken } from "../parse/token"; -import { weekOfYear } from "./week"; -import toInt from "../utils/to-int"; -import { hooks } from "../utils/hooks"; -import { createLocal } from "../create/local"; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex'; +import { addWeekParseToken } from '../parse/token'; +import { weekOfYear } from './week'; +import toInt from '../utils/to-int'; +import { hooks } from '../utils/hooks'; +import { createLocal } from '../create/local'; // FORMATTING -addFormatToken(0, ["gg", 2], 0, function () { +addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); -addFormatToken(0, ["GG", 2], 0, function () { +addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); @@ -21,32 +21,32 @@ function addWeekYearFormatToken (token, getter) { addFormatToken(0, [token, token.length], 0, getter); } -addWeekYearFormatToken("gggg", "weekYear"); -addWeekYearFormatToken("ggggg", "weekYear"); -addWeekYearFormatToken("GGGG", "isoWeekYear"); -addWeekYearFormatToken("GGGGG", "isoWeekYear"); +addWeekYearFormatToken('gggg', 'weekYear'); +addWeekYearFormatToken('ggggg', 'weekYear'); +addWeekYearFormatToken('GGGG', 'isoWeekYear'); +addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES -addUnitAlias("weekYear", "gg"); -addUnitAlias("isoWeekYear", "GG"); +addUnitAlias('weekYear', 'gg'); +addUnitAlias('isoWeekYear', 'GG'); // PARSING -addRegexToken("G", matchSigned); -addRegexToken("g", matchSigned); -addRegexToken("GG", match1to2, match2); -addRegexToken("gg", match1to2, match2); -addRegexToken("GGGG", match1to4, match4); -addRegexToken("gggg", match1to4, match4); -addRegexToken("GGGGG", match1to6, match6); -addRegexToken("ggggg", match1to6, match6); +addRegexToken('G', matchSigned); +addRegexToken('g', matchSigned); +addRegexToken('GG', match1to2, match2); +addRegexToken('gg', match1to2, match2); +addRegexToken('GGGG', match1to4, match4); +addRegexToken('gggg', match1to4, match4); +addRegexToken('GGGGG', match1to6, match6); +addRegexToken('ggggg', match1to6, match6); -addWeekParseToken(["gggg", "ggggg", "GGGG", "GGGGG"], function (input, week, config, token) { +addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); }); -addWeekParseToken(["gg", "GG"], function (input, week, config, token) { +addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); diff --git a/src/lib/units/week.js b/src/lib/units/week.js index 0e4cf2543..178f6b551 100644 --- a/src/lib/units/week.js +++ b/src/lib/units/week.js @@ -1,28 +1,28 @@ -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match2 } from "../parse/regex"; -import { addWeekParseToken } from "../parse/token"; -import toInt from "../utils/to-int"; -import { createLocal } from "../create/local"; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match2 } from '../parse/regex'; +import { addWeekParseToken } from '../parse/token'; +import toInt from '../utils/to-int'; +import { createLocal } from '../create/local'; // FORMATTING -addFormatToken("w", ["ww", 2], "wo", "week"); -addFormatToken("W", ["WW", 2], "Wo", "isoWeek"); +addFormatToken('w', ['ww', 2], 'wo', 'week'); +addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES -addUnitAlias("week", "w"); -addUnitAlias("isoWeek", "W"); +addUnitAlias('week', 'w'); +addUnitAlias('isoWeek', 'W'); // PARSING -addRegexToken("w", match1to2); -addRegexToken("ww", match1to2, match2); -addRegexToken("W", match1to2); -addRegexToken("WW", match1to2, match2); +addRegexToken('w', match1to2); +addRegexToken('ww', match1to2, match2); +addRegexToken('W', match1to2); +addRegexToken('WW', match1to2, match2); -addWeekParseToken(["w", "ww", "W", "WW"], function (input, week, config, token) { +addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { week[token.substr(0, 1)] = toInt(input); }); diff --git a/src/lib/units/year.js b/src/lib/units/year.js index 94dd0ca72..4d8a03b14 100644 --- a/src/lib/units/year.js +++ b/src/lib/units/year.js @@ -1,36 +1,36 @@ -import { makeGetSet } from "../moment/get-set"; -import { addFormatToken } from "../format/format"; -import { addUnitAlias } from "./aliases"; -import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from "../parse/regex"; -import { addParseToken } from "../parse/token"; -import { hooks } from "../utils/hooks"; -import { YEAR } from "./constants"; -import toInt from "../utils/to-int"; +import { makeGetSet } from '../moment/get-set'; +import { addFormatToken } from '../format/format'; +import { addUnitAlias } from './aliases'; +import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex'; +import { addParseToken } from '../parse/token'; +import { hooks } from '../utils/hooks'; +import { YEAR } from './constants'; +import toInt from '../utils/to-int'; // FORMATTING -addFormatToken(0, ["YY", 2], 0, function () { +addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); -addFormatToken(0, ["YYYY", 4], 0, "year"); -addFormatToken(0, ["YYYYY", 5], 0, "year"); -addFormatToken(0, ["YYYYYY", 6, true], 0, "year"); +addFormatToken(0, ['YYYY', 4], 0, 'year'); +addFormatToken(0, ['YYYYY', 5], 0, 'year'); +addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES -addUnitAlias("year", "y"); +addUnitAlias('year', 'y'); // PARSING -addRegexToken("Y", matchSigned); -addRegexToken("YY", match1to2, match2); -addRegexToken("YYYY", match1to4, match4); -addRegexToken("YYYYY", match1to6, match6); -addRegexToken("YYYYYY", match1to6, match6); +addRegexToken('Y', matchSigned); +addRegexToken('YY', match1to2, match2); +addRegexToken('YYYY', match1to4, match4); +addRegexToken('YYYYY', match1to6, match6); +addRegexToken('YYYYYY', match1to6, match6); -addParseToken(["YYYY", "YYYYY", "YYYYYY"], YEAR); -addParseToken("YY", function (input, array) { +addParseToken(['YYYY', 'YYYYY', 'YYYYYY'], YEAR); +addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); diff --git a/src/lib/utils/compare-arrays.js b/src/lib/utils/compare-arrays.js index 78a60f14e..2eb274bef 100644 --- a/src/lib/utils/compare-arrays.js +++ b/src/lib/utils/compare-arrays.js @@ -1,4 +1,4 @@ -import toInt from "./to-int"; +import toInt from './to-int'; // compare two arrays, return the number of differences export default function compareArrays(array1, array2, dontConvert) { diff --git a/src/lib/utils/deprecate.js b/src/lib/utils/deprecate.js index 23557b0c8..80fecf027 100644 --- a/src/lib/utils/deprecate.js +++ b/src/lib/utils/deprecate.js @@ -1,5 +1,5 @@ -import extend from "./extend"; -import { hooks } from "./hooks"; +import extend from './extend'; +import { hooks } from './hooks'; function warn(msg) { if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { diff --git a/src/lib/utils/extend.js b/src/lib/utils/extend.js index 9822bef6d..ba74a0bf1 100644 --- a/src/lib/utils/extend.js +++ b/src/lib/utils/extend.js @@ -1,4 +1,4 @@ -import hasOwnProp from "./has-own-prop"; +import hasOwnProp from './has-own-prop'; export default function extend(a, b) { for (var i in b) { diff --git a/src/locale/af.js b/src/locale/af.js index da81a5409..76673226c 100644 --- a/src/locale/af.js +++ b/src/locale/af.js @@ -2,7 +2,7 @@ //! locale : afrikaans (af) //! author : Werner Mollentze : https://github.com/wernerm -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('af', { months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'), diff --git a/src/locale/ar-ma.js b/src/locale/ar-ma.js index 1eb2db290..374468ebd 100644 --- a/src/locale/ar-ma.js +++ b/src/locale/ar-ma.js @@ -3,7 +3,7 @@ //! author : ElFadili Yassine : https://github.com/ElFadiliY //! author : Abdel Said : https://github.com/abdelsaid -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ar-ma', { months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), diff --git a/src/locale/ar-sa.js b/src/locale/ar-sa.js index 06437ae71..a0ef282d9 100644 --- a/src/locale/ar-sa.js +++ b/src/locale/ar-sa.js @@ -2,7 +2,7 @@ //! locale : Arabic Saudi Arabia (ar-sa) //! author : Suhail Alkowaileet : https://github.com/xsoh -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '١', diff --git a/src/locale/ar-tn.js b/src/locale/ar-tn.js index 5cedce21e..acb3e0890 100644 --- a/src/locale/ar-tn.js +++ b/src/locale/ar-tn.js @@ -1,7 +1,7 @@ //! moment.js locale configuration //! locale : Tunisian Arabic (ar-tn) -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ar-tn', { months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), diff --git a/src/locale/ar.js b/src/locale/ar.js index 5a57c67fe..d3a5bfcc5 100644 --- a/src/locale/ar.js +++ b/src/locale/ar.js @@ -4,7 +4,7 @@ //! Changes in months, weekdays: Ahmed Elkhatib //! Native plural forms: forabi https://github.com/forabi -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '١', diff --git a/src/locale/az.js b/src/locale/az.js index 18600ff6c..ecf93523c 100644 --- a/src/locale/az.js +++ b/src/locale/az.js @@ -2,7 +2,7 @@ //! locale : azerbaijani (az) //! author : topchiyev : https://github.com/topchiyev -import moment from "../moment"; +import moment from '../moment'; var suffixes = { 1: '-inci', diff --git a/src/locale/be.js b/src/locale/be.js index 07c4250de..c14511663 100644 --- a/src/locale/be.js +++ b/src/locale/be.js @@ -4,7 +4,7 @@ //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire -import moment from "../moment"; +import moment from '../moment'; function plural(word, num) { var forms = word.split('_'); diff --git a/src/locale/bg.js b/src/locale/bg.js index 0ff56aeee..a1f1f7283 100644 --- a/src/locale/bg.js +++ b/src/locale/bg.js @@ -2,7 +2,7 @@ //! locale : bulgarian (bg) //! author : Krasen Borisov : https://github.com/kraz -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('bg', { months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), diff --git a/src/locale/bn.js b/src/locale/bn.js index a8bd8888b..3a16085c7 100644 --- a/src/locale/bn.js +++ b/src/locale/bn.js @@ -2,7 +2,7 @@ //! locale : Bengali (bn) //! author : Kaushik Gandhi : https://github.com/kaushikgandhi -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '১', diff --git a/src/locale/bo.js b/src/locale/bo.js index 8f8e11508..102bf3af3 100644 --- a/src/locale/bo.js +++ b/src/locale/bo.js @@ -2,7 +2,7 @@ //! locale : tibetan (bo) //! author : Thupten N. Chakrishar : https://github.com/vajradog -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '༡', diff --git a/src/locale/br.js b/src/locale/br.js index 1f1ee6a7d..d6b501d16 100644 --- a/src/locale/br.js +++ b/src/locale/br.js @@ -2,7 +2,7 @@ //! locale : breton (br) //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou -import moment from "../moment"; +import moment from '../moment'; function relativeTimeWithMutation(number, withoutSuffix, key) { var format = { diff --git a/src/locale/bs.js b/src/locale/bs.js index 745102704..62b7f8ed5 100644 --- a/src/locale/bs.js +++ b/src/locale/bs.js @@ -3,7 +3,7 @@ //! author : Nedim Cholich : https://github.com/frontyard //! based on (hr) translation by Bojan Marković -import moment from "../moment"; +import moment from '../moment'; function translate(number, withoutSuffix, key) { var result = number + ' '; diff --git a/src/locale/ca.js b/src/locale/ca.js index 2f1d08763..f03f4501f 100644 --- a/src/locale/ca.js +++ b/src/locale/ca.js @@ -2,7 +2,7 @@ //! locale : catalan (ca) //! author : Juan G. Hurtado : https://github.com/juanghurtado -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ca', { months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'), diff --git a/src/locale/cs.js b/src/locale/cs.js index 986745014..9388ee88e 100644 --- a/src/locale/cs.js +++ b/src/locale/cs.js @@ -2,7 +2,7 @@ //! locale : czech (cs) //! author : petrbela : https://github.com/petrbela -import moment from "../moment"; +import moment from '../moment'; var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'), monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'); diff --git a/src/locale/cv.js b/src/locale/cv.js index 47d443671..dc50da3ae 100644 --- a/src/locale/cv.js +++ b/src/locale/cv.js @@ -2,7 +2,7 @@ //! locale : chuvash (cv) //! author : Anatoly Mironov : https://github.com/mirontoli -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('cv', { months : 'кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав'.split('_'), diff --git a/src/locale/cy.js b/src/locale/cy.js index ca8e0b0d0..2d574a6e2 100644 --- a/src/locale/cy.js +++ b/src/locale/cy.js @@ -2,7 +2,7 @@ //! locale : Welsh (cy) //! author : Robert Allen -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('cy', { months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), diff --git a/src/locale/da.js b/src/locale/da.js index 2823402a8..9ee01132a 100644 --- a/src/locale/da.js +++ b/src/locale/da.js @@ -2,7 +2,7 @@ //! locale : danish (da) //! author : Ulrik Nielsen : https://github.com/mrbase -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('da', { months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), diff --git a/src/locale/de-at.js b/src/locale/de-at.js index ef1336a44..4aae191bd 100644 --- a/src/locale/de-at.js +++ b/src/locale/de-at.js @@ -4,7 +4,7 @@ //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG -import moment from "../moment"; +import moment from '../moment'; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { diff --git a/src/locale/de.js b/src/locale/de.js index e62b39f14..58c0c30e3 100644 --- a/src/locale/de.js +++ b/src/locale/de.js @@ -3,7 +3,7 @@ //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire -import moment from "../moment"; +import moment from '../moment'; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { diff --git a/src/locale/el.js b/src/locale/el.js index dec25679f..8830ada00 100644 --- a/src/locale/el.js +++ b/src/locale/el.js @@ -2,7 +2,7 @@ //! locale : modern greek (el) //! author : Aggelos Karalias : https://github.com/mehiel -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('el', { monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), diff --git a/src/locale/en-au.js b/src/locale/en-au.js index 327fde553..a06b6cb71 100644 --- a/src/locale/en-au.js +++ b/src/locale/en-au.js @@ -1,7 +1,7 @@ //! moment.js locale configuration //! locale : australian english (en-au) -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('en-au', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), diff --git a/src/locale/en-ca.js b/src/locale/en-ca.js index ccc774efc..b33f8ab74 100644 --- a/src/locale/en-ca.js +++ b/src/locale/en-ca.js @@ -2,7 +2,7 @@ //! locale : canadian english (en-ca) //! author : Jonathan Abourbih : https://github.com/jonbca -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('en-ca', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), diff --git a/src/locale/en-gb.js b/src/locale/en-gb.js index 29191f3db..09961dd8e 100644 --- a/src/locale/en-gb.js +++ b/src/locale/en-gb.js @@ -2,7 +2,7 @@ //! locale : great britain english (en-gb) //! author : Chris Gedrim : https://github.com/chrisgedrim -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('en-gb', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), diff --git a/src/locale/eo.js b/src/locale/eo.js index 6e8ebc72d..54ecf793a 100644 --- a/src/locale/eo.js +++ b/src/locale/eo.js @@ -4,7 +4,7 @@ //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('eo', { months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'), diff --git a/src/locale/es.js b/src/locale/es.js index fc53c63e7..bcad04818 100644 --- a/src/locale/es.js +++ b/src/locale/es.js @@ -2,7 +2,7 @@ //! locale : spanish (es) //! author : Julio Napurí : https://github.com/julionc -import moment from "../moment"; +import moment from '../moment'; var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); diff --git a/src/locale/et.js b/src/locale/et.js index 309a4665e..68cbad949 100644 --- a/src/locale/et.js +++ b/src/locale/et.js @@ -3,7 +3,7 @@ //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka -import moment from "../moment"; +import moment from '../moment'; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { diff --git a/src/locale/eu.js b/src/locale/eu.js index 5cc600e43..2a05907b3 100644 --- a/src/locale/eu.js +++ b/src/locale/eu.js @@ -2,7 +2,7 @@ //! locale : euskara (eu) //! author : Eneko Illarramendi : https://github.com/eillarra -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('eu', { months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), diff --git a/src/locale/fa.js b/src/locale/fa.js index f590c23cf..e898adfaf 100644 --- a/src/locale/fa.js +++ b/src/locale/fa.js @@ -2,7 +2,7 @@ //! locale : Persian (fa) //! author : Ebrahim Byagowi : https://github.com/ebraminio -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '۱', diff --git a/src/locale/fi.js b/src/locale/fi.js index e0c4103b4..ee3851611 100644 --- a/src/locale/fi.js +++ b/src/locale/fi.js @@ -2,7 +2,7 @@ //! locale : finnish (fi) //! author : Tarmo Aidantausta : https://github.com/bleadof -import moment from "../moment"; +import moment from '../moment'; var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), numbersFuture = [ diff --git a/src/locale/fo.js b/src/locale/fo.js index 3c420f4bf..28a8e17af 100644 --- a/src/locale/fo.js +++ b/src/locale/fo.js @@ -2,7 +2,7 @@ //! locale : faroese (fo) //! author : Ragnar Johannesen : https://github.com/ragnar123 -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('fo', { months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), diff --git a/src/locale/fr-ca.js b/src/locale/fr-ca.js index f4254ce46..ef95bd2e6 100644 --- a/src/locale/fr-ca.js +++ b/src/locale/fr-ca.js @@ -2,7 +2,7 @@ //! locale : canadian french (fr-ca) //! author : Jonathan Abourbih : https://github.com/jonbca -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('fr-ca', { months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), diff --git a/src/locale/fr.js b/src/locale/fr.js index b6612a456..7492f85bf 100644 --- a/src/locale/fr.js +++ b/src/locale/fr.js @@ -2,7 +2,7 @@ //! locale : french (fr) //! author : John Fischer : https://github.com/jfroffice -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('fr', { months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), diff --git a/src/locale/fy.js b/src/locale/fy.js index d04c0e27e..2ccf17905 100644 --- a/src/locale/fy.js +++ b/src/locale/fy.js @@ -2,7 +2,7 @@ //! locale : frisian (fy) //! author : Robin van der Vliet : https://github.com/robin0van0der0v -import moment from "../moment"; +import moment from '../moment'; var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'), monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'); diff --git a/src/locale/gl.js b/src/locale/gl.js index 3d6edf913..44138096d 100644 --- a/src/locale/gl.js +++ b/src/locale/gl.js @@ -2,7 +2,7 @@ //! locale : galician (gl) //! author : Juan G. Hurtado : https://github.com/juanghurtado -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('gl', { months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'), diff --git a/src/locale/he.js b/src/locale/he.js index bcbb00942..dd4f2d2ce 100644 --- a/src/locale/he.js +++ b/src/locale/he.js @@ -4,7 +4,7 @@ //! author : Moshe Simantov : https://github.com/DevelopmentIL //! author : Tal Ater : https://github.com/TalAter -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('he', { months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'), diff --git a/src/locale/hi.js b/src/locale/hi.js index 051999ef9..3d568395b 100644 --- a/src/locale/hi.js +++ b/src/locale/hi.js @@ -2,7 +2,7 @@ //! locale : hindi (hi) //! author : Mayank Singhal : https://github.com/mayanksinghal -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '१', diff --git a/src/locale/hr.js b/src/locale/hr.js index d15496298..76708440f 100644 --- a/src/locale/hr.js +++ b/src/locale/hr.js @@ -2,7 +2,7 @@ //! locale : hrvatski (hr) //! author : Bojan Marković : https://github.com/bmarkovic -import moment from "../moment"; +import moment from '../moment'; function translate(number, withoutSuffix, key) { var result = number + ' '; diff --git a/src/locale/hu.js b/src/locale/hu.js index c484abbcc..9359a3cfd 100644 --- a/src/locale/hu.js +++ b/src/locale/hu.js @@ -2,7 +2,7 @@ //! locale : hungarian (hu) //! author : Adam Brunner : https://github.com/adambrunner -import moment from "../moment"; +import moment from '../moment'; var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); function translate(number, withoutSuffix, key, isFuture) { diff --git a/src/locale/hy-am.js b/src/locale/hy-am.js index a9768975c..fdaac2f98 100644 --- a/src/locale/hy-am.js +++ b/src/locale/hy-am.js @@ -2,7 +2,7 @@ //! locale : Armenian (hy-am) //! author : Armendarabyan : https://github.com/armendarabyan -import moment from "../moment"; +import moment from '../moment'; function monthsCaseReplace(m, format) { var months = { diff --git a/src/locale/id.js b/src/locale/id.js index bf5f44c29..8af7f0252 100644 --- a/src/locale/id.js +++ b/src/locale/id.js @@ -3,7 +3,7 @@ //! author : Mohammad Satrio Utomo : https://github.com/tyok //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('id', { months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'), diff --git a/src/locale/is.js b/src/locale/is.js index 6639ed6fe..13b8815cd 100644 --- a/src/locale/is.js +++ b/src/locale/is.js @@ -2,7 +2,7 @@ //! locale : icelandic (is) //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik -import moment from "../moment"; +import moment from '../moment'; function plural(n) { if (n % 100 === 11) { diff --git a/src/locale/it.js b/src/locale/it.js index 8743e7cb7..63f34ac5c 100644 --- a/src/locale/it.js +++ b/src/locale/it.js @@ -3,7 +3,7 @@ //! author : Lorenzo : https://github.com/aliem //! author: Mattia Larentis: https://github.com/nostalgiaz -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('it', { months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), diff --git a/src/locale/ja.js b/src/locale/ja.js index 7acc6bb37..1f9b865fa 100644 --- a/src/locale/ja.js +++ b/src/locale/ja.js @@ -2,7 +2,7 @@ //! locale : japanese (ja) //! author : LI Long : https://github.com/baryon -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ja', { months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), diff --git a/src/locale/ka.js b/src/locale/ka.js index f49e99371..a750b2a9a 100644 --- a/src/locale/ka.js +++ b/src/locale/ka.js @@ -2,7 +2,7 @@ //! locale : Georgian (ka) //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili -import moment from "../moment"; +import moment from '../moment'; function monthsCaseReplace(m, format) { var months = { diff --git a/src/locale/km.js b/src/locale/km.js index bfef9ce78..db9147ec9 100644 --- a/src/locale/km.js +++ b/src/locale/km.js @@ -2,7 +2,7 @@ //! locale : khmer (km) //! author : Kruy Vanna : https://github.com/kruyvanna -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('km', { months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), diff --git a/src/locale/ko.js b/src/locale/ko.js index 02e6045fc..a56aee0bc 100644 --- a/src/locale/ko.js +++ b/src/locale/ko.js @@ -6,7 +6,7 @@ //! - Kyungwook, Park : https://github.com/kyungw00k //! - Jeeeyul Lee -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ko', { months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), diff --git a/src/locale/lb.js b/src/locale/lb.js index 1e921f3d4..6cc6d5558 100644 --- a/src/locale/lb.js +++ b/src/locale/lb.js @@ -2,7 +2,7 @@ //! locale : Luxembourgish (lb) //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz -import moment from "../moment"; +import moment from '../moment'; function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { diff --git a/src/locale/lt.js b/src/locale/lt.js index bfaed8490..809516382 100644 --- a/src/locale/lt.js +++ b/src/locale/lt.js @@ -2,7 +2,7 @@ //! locale : Lithuanian (lt) //! author : Mindaugas Mozūras : https://github.com/mmozuras -import moment from "../moment"; +import moment from '../moment'; var units = { 'm' : 'minutė_minutės_minutę', diff --git a/src/locale/lv.js b/src/locale/lv.js index 94b1a7340..0506c851c 100644 --- a/src/locale/lv.js +++ b/src/locale/lv.js @@ -2,7 +2,7 @@ //! locale : latvian (lv) //! author : Kristaps Karlsons : https://github.com/skakri -import moment from "../moment"; +import moment from '../moment'; var units = { 'mm': 'minūti_minūtes_minūte_minūtes', diff --git a/src/locale/mk.js b/src/locale/mk.js index 601570cf0..80c522d41 100644 --- a/src/locale/mk.js +++ b/src/locale/mk.js @@ -2,7 +2,7 @@ //! locale : macedonian (mk) //! author : Borislav Mickov : https://github.com/B0k0 -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('mk', { months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'), diff --git a/src/locale/ml.js b/src/locale/ml.js index ca3b15dab..cbb90562e 100644 --- a/src/locale/ml.js +++ b/src/locale/ml.js @@ -2,7 +2,7 @@ //! locale : malayalam (ml) //! author : Floyd Pink : https://github.com/floydpink -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ml', { months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'), diff --git a/src/locale/mr.js b/src/locale/mr.js index eb27372b4..2ed77d150 100644 --- a/src/locale/mr.js +++ b/src/locale/mr.js @@ -2,7 +2,7 @@ //! locale : Marathi (mr) //! author : Harshad Kale : https://github.com/kalehv -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '१', diff --git a/src/locale/ms-my.js b/src/locale/ms-my.js index 2373f071d..10bce036b 100644 --- a/src/locale/ms-my.js +++ b/src/locale/ms-my.js @@ -2,7 +2,7 @@ //! locale : Bahasa Malaysia (ms-MY) //! author : Weldan Jamili : https://github.com/weldan -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ms-my', { months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), diff --git a/src/locale/my.js b/src/locale/my.js index 987319447..20d76dace 100644 --- a/src/locale/my.js +++ b/src/locale/my.js @@ -2,7 +2,7 @@ //! locale : Burmese (my) //! author : Squar team, mysquar.com -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '၁', diff --git a/src/locale/nb.js b/src/locale/nb.js index 9e17968bd..cadc224d6 100644 --- a/src/locale/nb.js +++ b/src/locale/nb.js @@ -3,7 +3,7 @@ //! authors : Espen Hovlandsdal : https://github.com/rexxars //! Sigurd Gartmann : https://github.com/sigurdga -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('nb', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), diff --git a/src/locale/ne.js b/src/locale/ne.js index d18139ddc..966db269d 100644 --- a/src/locale/ne.js +++ b/src/locale/ne.js @@ -2,7 +2,7 @@ //! locale : nepali/nepalese //! author : suvash : https://github.com/suvash -import moment from "../moment"; +import moment from '../moment'; var symbolMap = { '1': '१', diff --git a/src/locale/nl.js b/src/locale/nl.js index f3f44e5b6..f493a7673 100644 --- a/src/locale/nl.js +++ b/src/locale/nl.js @@ -2,7 +2,7 @@ //! locale : dutch (nl) //! author : Joris Röling : https://github.com/jjupiter -import moment from "../moment"; +import moment from '../moment'; var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); diff --git a/src/locale/nn.js b/src/locale/nn.js index f8dae395b..b3f76c56e 100644 --- a/src/locale/nn.js +++ b/src/locale/nn.js @@ -2,7 +2,7 @@ //! locale : norwegian nynorsk (nn) //! author : https://github.com/mechuwind -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('nn', { months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), diff --git a/src/locale/pl.js b/src/locale/pl.js index 089eab3c6..a50011f42 100644 --- a/src/locale/pl.js +++ b/src/locale/pl.js @@ -2,7 +2,7 @@ //! locale : polish (pl) //! author : Rafal Hirsz : https://github.com/evoL -import moment from "../moment"; +import moment from '../moment'; var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'), monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_'); diff --git a/src/locale/pt-br.js b/src/locale/pt-br.js index 138a93180..f57cfeb4a 100644 --- a/src/locale/pt-br.js +++ b/src/locale/pt-br.js @@ -2,7 +2,7 @@ //! locale : brazilian portuguese (pt-br) //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('pt-br', { months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'), diff --git a/src/locale/pt.js b/src/locale/pt.js index ece7f0107..3cd97b747 100644 --- a/src/locale/pt.js +++ b/src/locale/pt.js @@ -2,7 +2,7 @@ //! locale : portuguese (pt) //! author : Jefferson : https://github.com/jalex79 -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('pt', { months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'), diff --git a/src/locale/ro.js b/src/locale/ro.js index 6ae73c7d4..de6cebf0c 100644 --- a/src/locale/ro.js +++ b/src/locale/ro.js @@ -3,7 +3,7 @@ //! author : Vlad Gurdiga : https://github.com/gurdiga //! author : Valentin Agachi : https://github.com/avaly -import moment from "../moment"; +import moment from '../moment'; function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { diff --git a/src/locale/ru.js b/src/locale/ru.js index 3aa9d076b..8a210a46e 100644 --- a/src/locale/ru.js +++ b/src/locale/ru.js @@ -3,7 +3,7 @@ //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire -import moment from "../moment"; +import moment from '../moment'; function plural(word, num) { var forms = word.split('_'); diff --git a/src/locale/sk.js b/src/locale/sk.js index 040f022c0..4ac38c302 100644 --- a/src/locale/sk.js +++ b/src/locale/sk.js @@ -3,7 +3,7 @@ //! author : Martin Minka : https://github.com/k2s //! based on work of petrbela : https://github.com/petrbela -import moment from "../moment"; +import moment from '../moment'; var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'), monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); diff --git a/src/locale/sl.js b/src/locale/sl.js index c7ed921dc..a4b486de6 100644 --- a/src/locale/sl.js +++ b/src/locale/sl.js @@ -2,7 +2,7 @@ //! locale : slovenian (sl) //! author : Robert Sedovšek : https://github.com/sedovsek -import moment from "../moment"; +import moment from '../moment'; function translate(number, withoutSuffix, key) { var result = number + ' '; diff --git a/src/locale/sq.js b/src/locale/sq.js index 23c31d2c8..76172b467 100644 --- a/src/locale/sq.js +++ b/src/locale/sq.js @@ -4,7 +4,7 @@ //! author: Menelion Elensúle: https://github.com/Oire (tests) //! author : Oerd Cukalla : https://github.com/oerd (fixes) -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('sq', { months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'), diff --git a/src/locale/sr-cyrl.js b/src/locale/sr-cyrl.js index d24de0e3c..1da53e3f2 100644 --- a/src/locale/sr-cyrl.js +++ b/src/locale/sr-cyrl.js @@ -2,7 +2,7 @@ //! locale : Serbian-cyrillic (sr-cyrl) //! author : Milan Janačković : https://github.com/milan-j -import moment from "../moment"; +import moment from '../moment'; var translator = { words: { //Different grammatical cases diff --git a/src/locale/sr.js b/src/locale/sr.js index 05815732a..210c7398f 100644 --- a/src/locale/sr.js +++ b/src/locale/sr.js @@ -2,7 +2,7 @@ //! locale : Serbian-latin (sr) //! author : Milan Janačković : https://github.com/milan-j -import moment from "../moment"; +import moment from '../moment'; var translator = { words: { //Different grammatical cases diff --git a/src/locale/sv.js b/src/locale/sv.js index 28a723df4..bec21e94f 100644 --- a/src/locale/sv.js +++ b/src/locale/sv.js @@ -2,7 +2,7 @@ //! locale : swedish (sv) //! author : Jens Alm : https://github.com/ulmus -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('sv', { months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), diff --git a/src/locale/ta.js b/src/locale/ta.js index 5fdc35807..4341c3e72 100644 --- a/src/locale/ta.js +++ b/src/locale/ta.js @@ -2,7 +2,7 @@ //! locale : tamil (ta) //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('ta', { months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), diff --git a/src/locale/th.js b/src/locale/th.js index 642249ea0..2382d2541 100644 --- a/src/locale/th.js +++ b/src/locale/th.js @@ -2,7 +2,7 @@ //! locale : thai (th) //! author : Kridsada Thanabulpong : https://github.com/sirn -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('th', { months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'), diff --git a/src/locale/tl-ph.js b/src/locale/tl-ph.js index d8e120947..a1b24a710 100644 --- a/src/locale/tl-ph.js +++ b/src/locale/tl-ph.js @@ -2,7 +2,7 @@ //! locale : Tagalog/Filipino (tl-ph) //! author : Dan Hagman -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('tl-ph', { months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'), diff --git a/src/locale/tr.js b/src/locale/tr.js index 938a29cff..78f2b6978 100644 --- a/src/locale/tr.js +++ b/src/locale/tr.js @@ -3,7 +3,7 @@ //! authors : Erhan Gundogan : https://github.com/erhangundogan, //! Burak Yiğit Kaya: https://github.com/BYK -import moment from "../moment"; +import moment from '../moment'; var suffixes = { 1: '\'inci', diff --git a/src/locale/tzm-latn.js b/src/locale/tzm-latn.js index 1c9f70e89..153e51f99 100644 --- a/src/locale/tzm-latn.js +++ b/src/locale/tzm-latn.js @@ -2,7 +2,7 @@ //! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn) //! author : Abdel Said : https://github.com/abdelsaid -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('tzm-latn', { months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), diff --git a/src/locale/tzm.js b/src/locale/tzm.js index 432a750dc..b53adb06d 100644 --- a/src/locale/tzm.js +++ b/src/locale/tzm.js @@ -2,7 +2,7 @@ //! locale : Morocco Central Atlas Tamaziɣt (tzm) //! author : Abdel Said : https://github.com/abdelsaid -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('tzm', { months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), diff --git a/src/locale/uk.js b/src/locale/uk.js index 025985f1e..6fd7a1ef9 100644 --- a/src/locale/uk.js +++ b/src/locale/uk.js @@ -3,7 +3,7 @@ //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire -import moment from "../moment"; +import moment from '../moment'; function plural(word, num) { var forms = word.split('_'); diff --git a/src/locale/uz.js b/src/locale/uz.js index bceacf704..3732bfd8c 100644 --- a/src/locale/uz.js +++ b/src/locale/uz.js @@ -2,7 +2,7 @@ //! locale : uzbek (uz) //! author : Sardor Muminov : https://github.com/muminoff -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('uz', { months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), diff --git a/src/locale/vi.js b/src/locale/vi.js index 3023cce64..18ca9f3ed 100644 --- a/src/locale/vi.js +++ b/src/locale/vi.js @@ -2,7 +2,7 @@ //! locale : vietnamese (vi) //! author : Bang Nguyen : https://github.com/bangnk -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('vi', { months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), diff --git a/src/locale/zh-cn.js b/src/locale/zh-cn.js index b8a438be8..3dcea9da0 100644 --- a/src/locale/zh-cn.js +++ b/src/locale/zh-cn.js @@ -3,7 +3,7 @@ //! author : suupic : https://github.com/suupic //! author : Zeno Zeng : https://github.com/zenozeng -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('zh-cn', { months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), diff --git a/src/locale/zh-tw.js b/src/locale/zh-tw.js index d6021f41c..2f2c04329 100644 --- a/src/locale/zh-tw.js +++ b/src/locale/zh-tw.js @@ -2,7 +2,7 @@ //! locale : traditional chinese (zh-tw) //! author : Ben : https://github.com/ben-lin -import moment from "../moment"; +import moment from '../moment'; export default moment.defineLocale('zh-tw', { months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), diff --git a/src/moment.js b/src/moment.js index 9665f6429..33dc99b07 100644 --- a/src/moment.js +++ b/src/moment.js @@ -4,7 +4,7 @@ //! license : MIT //! momentjs.com -import { hooks as moment, setHookCallback } from "./lib/utils/hooks"; +import { hooks as moment, setHookCallback } from './lib/utils/hooks'; moment.version = '2.9.0'; @@ -18,7 +18,7 @@ import { createLocal as local, createInvalid as invalid, createInZone as parseZone -} from "./lib/moment/moment"; +} from './lib/moment/moment'; import { defineLocale, @@ -29,17 +29,17 @@ import { listWeekdays as weekdays, listWeekdaysMin as weekdaysMin, listWeekdaysShort as weekdaysShort -} from "./lib/locale/locale"; +} from './lib/locale/locale'; import { isDuration, createDuration as duration, getSetRelativeTimeThreshold as relativeTimeThreshold -} from "./lib/duration/duration"; +} from './lib/duration/duration'; -import { normalizeUnits } from "./lib/units/units"; +import { normalizeUnits } from './lib/units/units'; -import isDate from "./lib/utils/is-date"; +import isDate from './lib/utils/is-date'; setHookCallback(local); diff --git a/src/test/locale/af.js b/src/test/locale/af.js index a7f3886b5..0e99caee5 100644 --- a/src/test/locale/af.js +++ b/src/test/locale/af.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("af"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('af'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Januarie Jan_Februarie Feb_Maart Mar_April Apr_Mei Mei_Junie Jun_Julie Jul_Augustus Aug_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sondag, Februarie 14de 2010, 3:25:50 nm'], ['ddd, hA', 'Son, 3NM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Januarie Jan_Februarie Feb_Maart Mar_April Apr_Mei Mei_Junie Jun_Julie Jul_Augustus Aug_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Sondag Son So_Maandag Maa Ma_Dinsdag Din Di_Woensdag Woe Wo_Donderdag Don Do_Vrydag Vry Vr_Saterdag Sat Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '\'n paar sekondes', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '\'n minuut', '45 seconds = a minute'); @@ -137,21 +137,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaar', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'oor \'n paar sekondes', 'prefix'); assert.equal(moment(0).from(30000), '\'n paar sekondes gelede', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), '\'n paar sekondes gelede', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'oor \'n paar sekondes', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'oor 5 dae', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Vandag om 02:00', 'today at the same time'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Gister om 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -283,7 +283,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ar-ma.js b/src/test/locale/ar-ma.js index 863fd9dcd..ffc7a1dbc 100644 --- a/src/test/locale/ar-ma.js +++ b/src/test/locale/ar-ma.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ar-ma"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ar-ma'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'يناير:يناير_فبراير:فبراير_مارس:مارس_أبريل:أبريل_ماي:ماي_يونيو:يونيو_يوليوز:يوليوز_غشت:غشت_شتنبر:شتنبر_أكتوبر:أكتوبر_نونبر:نونبر_دجنبر:دجنبر'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'الأحد, فبراير 14 2010, 3:25:50 pm'], ['ddd, hA', 'احد, 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'يناير يناير_فبراير فبراير_مارس مارس_أبريل أبريل_ماي ماي_يونيو يونيو_يوليوز يوليوز_غشت غشت_شتنبر شتنبر_أكتوبر أكتوبر_نونبر نونبر_دجنبر دجنبر'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'الأحد احد ح_الإتنين اتنين ن_الثلاثاء ثلاثاء ث_الأربعاء اربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ثوان', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'دقيقة', '45 seconds = a minute'); @@ -137,21 +137,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 سنوات', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'في ثوان', 'prefix'); assert.equal(moment(0).from(30000), 'منذ ثوان', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'منذ ثوان', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'في ثوان', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'في 5 أيام', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'اليوم على الساعة 02:00', 'today at the same time'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'أمس على الساعة 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); @@ -251,7 +251,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); @@ -259,7 +259,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '1 01 1', 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 should be week 2'); @@ -267,7 +267,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -281,7 +281,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -294,7 +294,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ar-sa.js b/src/test/locale/ar-sa.js index 235bafb5f..c62799f20 100644 --- a/src/test/locale/ar-sa.js +++ b/src/test/locale/ar-sa.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ar-sa"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ar-sa'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'يناير:يناير_فبراير:فبراير_مارس:مارس_أبريل:أبريل_مايو:مايو_يونيو:يونيو_يوليو:يوليو_أغسطس:أغسطس_سبتمبر:سبتمبر_أكتوبر:أكتوبر_نوفمبر:نوفمبر_ديسمبر:ديسمبر'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month()); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'الأحد، فبراير ١٤ ٢٠١٠، ٣:٢٥:٥٠ م'], ['ddd, hA', 'أحد، ٣م'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '١', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '٢', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '٣', '3'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '٣١', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'يناير يناير_فبراير فبراير_مارس مارس_أبريل أبريل_مايو مايو_يونيو يونيو_يوليو يوليو_أغسطس أغسطس_سبتمبر سبتمبر_أكتوبر أكتوبر_نوفمبر نوفمبر_ديسمبر ديسمبر'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'الأحد أحد ح_الإثنين إثنين ن_الثلاثاء ثلاثاء ث_الأربعاء أربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ثوان', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'دقيقة', '45 seconds = a minute'); @@ -137,21 +137,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '٥ سنوات', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'في ثوان', 'prefix'); assert.equal(moment(0).from(30000), 'منذ ثوان', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'منذ ثوان', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'في ثوان', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'في ٥ أيام', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'اليوم على الساعة ٠٢:٠٠', 'today at the same time'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'أمس على الساعة ٠٢:٠٠', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); @@ -239,7 +239,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); @@ -248,7 +248,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); @@ -256,7 +256,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); @@ -264,7 +264,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '١ ٠١ ١', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '١ ٠١ ١', 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 7 2012 should be week 2'); @@ -272,7 +272,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -286,7 +286,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -299,7 +299,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ar-tn.js b/src/test/locale/ar-tn.js index 5d2e617c4..61fba3a39 100644 --- a/src/test/locale/ar-tn.js +++ b/src/test/locale/ar-tn.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ar-tn"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ar-tn'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'جانفي:جانفي_فيفري:فيفري_مارس:مارس_أفريل:أفريل_ماي:ماي_جوان:جوان_جويلية:جويلية_أوت:أوت_سبتمبر:سبتمبر_أكتوبر:أكتوبر_نوفمبر:نوفمبر_ديسمبر:ديسمبر'.split('_'), i; @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'الأحد, فيفري 14 2010, 3:25:50 pm'], ['ddd, hA', 'أحد, 3PM'], @@ -56,7 +56,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -93,7 +93,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'جانفي جانفي_فيفري فيفري_مارس مارس_أفريل أفريل_ماي ماي_جوان جوان_جويلية جويلية_أوت أوت_سبتمبر سبتمبر_أكتوبر أكتوبر_نوفمبر نوفمبر_ديسمبر ديسمبر'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -101,7 +101,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'الأحد أحد ح_الإثنين إثنين ن_الثلاثاء ثلاثاء ث_الأربعاء أربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -109,7 +109,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({ s: 44 @@ -197,16 +197,16 @@ test("from", function (assert) { }), true), '5 سنوات', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'في ثوان', 'prefix'); assert.equal(moment(0).from(30000), 'منذ ثوان', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'منذ ثوان', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({ s: 30 }).fromNow(), 'في ثوان', 'in a few seconds'); @@ -215,7 +215,7 @@ test("fromNow", function (assert) { }).fromNow(), 'في 5 أيام', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'اليوم على الساعة 02:00', 'today at the same time'); @@ -236,7 +236,7 @@ test("calendar day", function (assert) { }).calendar(), 'أمس على الساعة 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({ @@ -250,7 +250,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({ @@ -264,7 +264,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({ w: 1 }), @@ -286,7 +286,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -294,7 +294,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -302,7 +302,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -311,7 +311,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -320,7 +320,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -329,7 +329,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -338,7 +338,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -347,7 +347,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1'); @@ -355,7 +355,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -369,7 +369,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -382,7 +382,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ar.js b/src/test/locale/ar.js index 899cc0d93..067a17643 100644 --- a/src/test/locale/ar.js +++ b/src/test/locale/ar.js @@ -1,6 +1,6 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ar"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ar'); var months = [ 'كانون الثاني يناير', @@ -17,7 +17,7 @@ var months = [ 'كانون الأول ديسمبر' ]; -test("parse", function (assert) { +test('parse', function (assert) { var tests = months, i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month()); @@ -34,7 +34,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'الأحد، شباط فبراير ١٤ ٢٠١٠، ٣:٢٥:٥٠ م'], ['ddd, hA', 'أحد، ٣م'], @@ -68,7 +68,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '١', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '٢', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '٣', '3'); @@ -105,7 +105,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '٣١', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = months, i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM'), expected[i], expected[i]); @@ -113,14 +113,14 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'الأحد أحد ح_الإثنين إثنين ن_الثلاثاء ثلاثاء ث_الأربعاء أربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '٤٤ ثانية', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'دقيقة واحدة', '45 seconds = a minute'); @@ -152,21 +152,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '٥ أعوام', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'بعد ٣٠ ثانية', 'prefix'); assert.equal(moment(0).from(30000), 'منذ ٣٠ ثانية', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'منذ ثانية واحدة', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'بعد ٣٠ ثانية', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'بعد ٥ أيام', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'اليوم عند الساعة ٠٢:٠٠', 'today at the same time'); @@ -177,7 +177,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'أمس عند الساعة ٠٢:٠٠', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -189,7 +189,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -201,7 +201,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -215,7 +215,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); @@ -231,7 +231,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); @@ -240,7 +240,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); @@ -254,7 +254,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); @@ -263,7 +263,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); @@ -271,7 +271,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); @@ -279,7 +279,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '١ ٠١ ١', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '١ ٠١ ١', 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 7 2012 should be week 2'); @@ -287,7 +287,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -301,7 +301,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -314,7 +314,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/az.js b/src/test/locale/az.js index 178413d0a..c2955017d 100644 --- a/src/test/locale/az.js +++ b/src/test/locale/az.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("az"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('az'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'yanvar yan_fevral fev_mart mar_Aprel apr_may may_iyun iyn_iyul iyl_Avqust avq_sentyabr sen_oktyabr okt_noyabr noy_dekabr dek'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, D MMMM YYYY, HH:mm:ss', 'Bazar, 14 fevral 2010, 15:25:50'], ['ddd, A h', 'Baz, gündüz 3'], @@ -65,7 +65,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-inci', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-nci', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-üncü', '3rd'); @@ -102,21 +102,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-inci', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'yanvar yan_fevral fev_mart mar_aprel apr_may may_iyun iyn_iyul iyl_avqust avq_sentyabr sen_oktyabr okt_noyabr noy_dekabr dek'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Bazar Baz Bz_Bazar ertəsi BzE BE_Çərşənbə axşamı ÇAx ÇA_Çərşənbə Çər Çə_Cümə axşamı CAx CA_Cümə Cüm Cü_Şənbə Şən Şə'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'birneçə saniyyə', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'bir dəqiqə', '45 seconds = a minute'); @@ -147,21 +147,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 il', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'birneçə saniyyə sonra', 'prefix'); assert.equal(moment(0).from(30000), 'birneçə saniyyə əvvəl', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'birneçə saniyyə əvvəl', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'birneçə saniyyə sonra', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 gün sonra', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'bugün saat 02:00', 'today at the same time'); @@ -172,7 +172,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'dünən 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -184,7 +184,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -196,7 +196,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -210,7 +210,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -218,7 +218,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -226,7 +226,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -244,7 +244,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -253,7 +253,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -262,7 +262,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -271,7 +271,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-inci', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-inci', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-nci', 'Jan 2 2012 should be week 2'); @@ -279,7 +279,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-üncü', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -306,7 +306,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/be.js b/src/test/locale/be.js index 43304bb11..12bf28ec2 100644 --- a/src/test/locale/be.js +++ b/src/test/locale/be.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("be"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('be'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'студзень студ_люты лют_сакавік сак_красавік крас_травень трав_чэрвень чэрв_ліпень ліп_жнівень жнів_верасень вер_кастрычнік каст_лістапад ліст_снежань снеж'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, HH:mm:ss', 'нядзеля, 14-га лютага 2010, 15:25:50'], ['ddd, h A', 'нд, 3 дня'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format meridiem", function (assert) { +test('format meridiem', function (assert) { assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночы', 'night'); assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночы', 'night'); assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'раніцы', 'morning'); @@ -65,7 +65,7 @@ test("format meridiem", function (assert) { assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечара', 'evening'); }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ы', '1-ы'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-і', '2-і'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-і', '3-і'); @@ -102,14 +102,14 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ы', '31-ы'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'студзень студ_люты лют_сакавік сак_красавік крас_травень трав_чэрвень чэрв_ліпень ліп_жнівень жнів_верасень вер_кастрычнік каст_лістапад ліст_снежань снеж'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format month case", function (assert) { +test('format month case', function (assert) { var months = { 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') @@ -120,7 +120,7 @@ test("format month case", function (assert) { } }); -test("format month case with escaped symbols", function (assert) { +test('format month case with escaped symbols', function (assert) { var months = { 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') @@ -133,14 +133,14 @@ test("format month case with escaped symbols", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'нядзеля нд нд_панядзелак пн пн_аўторак ат ат_серада ср ср_чацвер чц чц_пятніца пт пт_субота сб сб'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'некалькі секунд', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'хвіліна', '45 seconds = a minute'); @@ -175,19 +175,19 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 гадоў', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'праз некалькі секунд', 'prefix'); assert.equal(moment(0).from(30000), 'некалькі секунд таму', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'праз некалькі секунд', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'праз 5 дзён', 'in 5 days'); assert.equal(moment().add({m: 31}).fromNow(), 'праз 31 хвіліну', 'in 31 minutes = in 31 minutes'); assert.equal(moment().subtract({m: 31}).fromNow(), '31 хвіліну таму', '31 minutes ago = 31 minutes ago'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Сёння ў 02:00', 'today at the same time'); @@ -198,7 +198,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Учора ў 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { return '[У] dddd [ў] LT'; @@ -214,7 +214,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -241,7 +241,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -255,7 +255,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -263,7 +263,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -271,7 +271,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -280,7 +280,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -289,7 +289,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -298,7 +298,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -307,7 +307,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -316,7 +316,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ы', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ы', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-і', 'Jan 2 2012 should be week 2'); @@ -324,7 +324,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-і', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -338,7 +338,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -351,7 +351,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/bg.js b/src/test/locale/bg.js index 8a7177b4e..8613a20e0 100644 --- a/src/test/locale/bg.js +++ b/src/test/locale/bg.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("bg"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('bg'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'януари янр_февруари фев_март мар_април апр_май май_юни юни_юли юли_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, H:mm:ss', 'неделя, февруари 14-ти 2010, 15:25:50'], ['ddd, hA', 'нед, 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ви', '1-ви'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ри', '2-ри'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ти', '3-ти'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ви', '31-ви'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'януари янр_февруари фев_март мар_април апр_май май_юни юни_юли юли_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'неделя нед нд_понеделник пон пн_вторник вто вт_сряда сря ср_четвъртък чет чт_петък пет пт_събота съб сб'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'няколко секунди', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); @@ -137,21 +137,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 години', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'след няколко секунди', 'prefix'); assert.equal(moment(0).from(30000), 'преди няколко секунди', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'преди няколко секунди', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'след няколко секунди', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'след 5 дни', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Днес в 2:00', 'today at the same time'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера в 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -201,7 +201,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -215,7 +215,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -231,7 +231,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -240,7 +240,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -249,7 +249,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -258,7 +258,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -267,7 +267,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -276,7 +276,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ви', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-ри', 'Jan 2 2012 should be week 2'); @@ -284,7 +284,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -311,7 +311,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/bn.js b/src/test/locale/bn.js index 84d449564..bba57e413 100644 --- a/src/test/locale/bn.js +++ b/src/test/locale/bn.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("bn"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('bn'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'জানুয়ারী জানু_ফেবুয়ারী ফেব_মার্চ মার্চ_এপ্রিল এপর_মে মে_জুন জুন_জুলাই জুল_অগাস্ট অগ_সেপ্টেম্বর সেপ্ট_অক্টোবর অক্টো_নভেম্বর নভ_ডিসেম্বর ডিসেম্'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, a h:mm:ss সময়', 'রবিবার, ১৪ ফেবুয়ারী ২০১০, দুপুর ৩:২৫:৫০ সময়'], ['ddd, a h সময়', 'রবি, দুপুর ৩ সময়'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '১', '১'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '২', '২'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '৩', '৩'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '৩১', '৩১'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'জানুয়ারী জানু_ফেবুয়ারী ফেব_মার্চ মার্চ_এপ্রিল এপর_মে মে_জুন জুন_জুলাই জুল_অগাস্ট অগ_সেপ্টেম্বর সেপ্ট_অক্টোবর অক্টো_নভেম্বর নভ_ডিসেম্বর ডিসেম্'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'রবিবার রবি রব_সোমবার সোম সম_মঙ্গলবার মঙ্গল মঙ্গ_বুধবার বুধ বু_বৃহস্পত্তিবার বৃহস্পত্তি ব্রিহ_শুক্রুবার শুক্রু শু_শনিবার শনি শনি'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'কএক সেকেন্ড', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'এক মিনিট', '45 seconds = a minute'); @@ -135,21 +135,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '৫ বছর', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'কএক সেকেন্ড পরে', 'prefix'); assert.equal(moment(0).from(30000), 'কএক সেকেন্ড আগে', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'কএক সেকেন্ড আগে', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'কএক সেকেন্ড পরে', 'কএক সেকেন্ড পরে'); assert.equal(moment().add({d: 5}).fromNow(), '৫ দিন পরে', '৫ দিন পরে'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'আজ রাত ২:০০ সময়', 'today at the same time'); @@ -160,7 +160,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'গতকাল রাত ২:০০ সময়', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -172,7 +172,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'রাত', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'শকাল', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'দুপুর', 'during day'); @@ -215,7 +215,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'রাত', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -276,7 +276,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '১ ০১ ১', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '১ ০১ ১', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '২ ০২ ২', 'Jan 8 2012 should be week 2'); @@ -284,7 +284,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '৩ ০৩ ৩', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -311,7 +311,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/bo.js b/src/test/locale/bo.js index 19bf5df6f..d415d3480 100644 --- a/src/test/locale/bo.js +++ b/src/test/locale/bo.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("bo"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('bo'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ཟླ་བ་དང་པོ ཟླ་བ་དང་པོ._ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, a h:mm:ss ལ་', 'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥:༥༠ ལ་'], ['ddd, a h ལ་', 'ཉི་མ་, ཉིན་གུང ༣ ལ་'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '༡', '༡'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '༢', '༢'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '༣', '༣'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '༣༡', '༣༡'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ཟླ་བ་དང་པོ ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'གཟའ་ཉི་མ་ ཉི་མ་ ཉི་མ་_གཟའ་ཟླ་བ་ ཟླ་བ་ ཟླ་བ་_གཟའ་མིག་དམར་ མིག་དམར་ མིག་དམར་_གཟའ་ལྷག་པ་ ལྷག་པ་ ལྷག་པ་_གཟའ་ཕུར་བུ ཕུར་བུ ཕུར་བུ_གཟའ་པ་སངས་ པ་སངས་ པ་སངས་_གཟའ་སྤེན་པ་ སྤེན་པ་ སྤེན་པ་'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ལམ་སང', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'སྐར་མ་གཅིག', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '༥ ལོ', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'ལམ་སང ལ་', 'prefix'); assert.equal(moment(0).from(30000), 'ལམ་སང སྔན་ལ', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'ལམ་སང སྔན་ལ', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'ལམ་སང ལ་', 'ལམ་སང ལ་'); assert.equal(moment().add({d: 5}).fromNow(), '༥ ཉིན་ ལ་', '༥ ཉིན་ ལ་'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'དི་རིང མཚན་མོ ༢:༠༠', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'ཁ་སང མཚན་མོ ༢:༠༠', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'མཚན་མོ', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'ཞོགས་ཀས', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ཉིན་གུང', 'during day'); @@ -216,7 +216,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'མཚན་མོ', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -224,7 +224,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -251,7 +251,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -260,7 +260,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -277,7 +277,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '༡ ༠༡ ༡', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '༡ ༠༡ ༡', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '༢ ༠༢ ༢', 'Jan 8 2012 should be week 2'); @@ -285,7 +285,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '༣ ༠༣ ༣', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -299,7 +299,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -312,7 +312,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/br.js b/src/test/locale/br.js index 5f45d39c6..12cb0f134 100644 --- a/src/test/locale/br.js +++ b/src/test/locale/br.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("br"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('br'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Genver Gen_C\'hwevrer C\'hwe_Meurzh Meu_Ebrel Ebr_Mae Mae_Mezheven Eve_Gouere Gou_Eost Eos_Gwengolo Gwe_Here Her_Du Du_Kerzu Ker'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { moment.locale('br'); var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sul, C\'hwevrer 14vet 2010, 3:25:50 pm'], @@ -48,7 +48,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { moment.locale('br'); assert.equal(moment([2011, 0, 1]).format('DDDo'), '1añ', '1añ'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2vet', '2vet'); @@ -86,7 +86,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31vet', '31vet'); }); -test("format month", function (assert) { +test('format month', function (assert) { moment.locale('br'); var expected = 'Genver Gen_C\'hwevrer C\'hwe_Meurzh Meu_Ebrel Ebr_Mae Mae_Mezheven Eve_Gouere Gou_Eost Eos_Gwengolo Gwe_Here Her_Du Du_Kerzu Ker'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -94,7 +94,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { moment.locale('br'); var expected = 'Sul Sul Su_Lun Lun Lu_Meurzh Meu Me_Merc\'her Mer Mer_Yaou Yao Ya_Gwener Gwe Gw_Sadorn Sad Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -102,7 +102,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { moment.locale('br'); var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'un nebeud segondennoù', '44 seconds = a few seconds'); @@ -135,24 +135,24 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 bloaz', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { moment.locale('br'); assert.equal(moment(30000).from(0), 'a-benn un nebeud segondennoù', 'prefix'); assert.equal(moment(0).from(30000), 'un nebeud segondennoù \'zo', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { moment.locale('br'); assert.equal(moment().fromNow(), 'un nebeud segondennoù \'zo', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { moment.locale('br'); assert.equal(moment().add({s: 30}).fromNow(), 'a-benn un nebeud segondennoù', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'a-benn 5 devezh', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { moment.locale('br'); var a = moment().hours(2).minutes(0).seconds(0); @@ -165,7 +165,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Dec\'h da 2e00 AM', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { moment.locale('br'); var i, m; @@ -179,7 +179,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { moment.locale('br'); var i, m; @@ -193,7 +193,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { moment.locale('br'); var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -208,7 +208,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("special mutations for years", function (assert) { +test('special mutations for years', function (assert) { moment.locale('br'); var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ur bloaz', 'mutation 1 year'); @@ -225,7 +225,7 @@ test("special mutations for years", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 261}), true), '261 bloaz', 'mutation 261 years'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -239,7 +239,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -252,7 +252,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/bs.js b/src/test/locale/bs.js index 47c58a7ea..ca70a25dc 100644 --- a/src/test/locale/bs.js +++ b/src/test/locale/bs.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("bs"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('bs'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan._februar feb._mart mar._april apr._maj maj._juni jun._juli jul._august aug._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedjelja, 14. februar 2010, 3:25:50 pm'], ['ddd, hA', 'ned., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan._februar feb._mart mar._april apr._maj maj._juni jun._juli jul._august aug._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'par sekundi', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedna minuta', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'za par sekundi', 'prefix'); assert.equal(moment(0).from(30000), 'prije par sekundi', 'prefix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'prije par sekundi', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'za par sekundi', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'jučer u 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { @@ -190,7 +190,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -218,7 +218,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -232,7 +232,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -240,7 +240,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -248,7 +248,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -257,7 +257,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -266,7 +266,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -275,7 +275,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -284,7 +284,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -293,7 +293,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -301,7 +301,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -315,7 +315,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -328,7 +328,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ca.js b/src/test/locale/ca.js index 67cdd2d91..1a0d06d58 100644 --- a/src/test/locale/ca.js +++ b/src/test/locale/ca.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ca"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ca'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'gener gen._febrer febr._març mar._abril abr._maig mai._juny jun._juliol jul._agost ag._setembre set._octubre oct._novembre nov._desembre des.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'diumenge, 14è febrer 2010, 3:25:50 pm'], ['ddd, hA', 'dg., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1r', '1r'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2n', '2n'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3r', '3r'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31è', '31è'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'gener gen._febrer febr._març mar._abril abr._maig mai._juny jun._juliol jul._agost ag._setembre set._octubre oct._novembre nov._desembre des.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'diumenge dg. Dg_dilluns dl. Dl_dimarts dt. Dt_dimecres dc. Dc_dijous dj. Dj_divendres dv. Dv_dissabte ds. Ds'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'uns segons', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minut', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anys', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'en uns segons', 'prefix'); assert.equal(moment(0).from(30000), 'fa uns segons', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'fa uns segons', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'en uns segons', 'en uns segons'); assert.equal(moment().add({d: 5}).fromNow(), 'en 5 dies', 'en 5 dies'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'avui a les 2:00', 'today at the same time'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'ahir a les 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52a', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1a', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1a', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2a', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -283,7 +283,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/cs.js b/src/test/locale/cs.js index e57f0c73c..fcac9717c 100644 --- a/src/test/locale/cs.js +++ b/src/test/locale/cs.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("cs"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('cs'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split('_'), i; function equalTest(input, mmm, monthIndex) { assert.equal(moment(input, mmm).month(), monthIndex, input + ' should be month ' + (monthIndex + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss', 'neděle, únor 14. 2010, 3:25:50'], ['ddd, h', 'ne, 3'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'neděle ne ne_pondělí po po_úterý út út_středa st st_čtvrtek čt čt_pátek pá pá_sobota so so'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'pár sekund', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuta', '45 seconds = a minute'); @@ -136,16 +136,16 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 let', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'za pár sekund', 'prefix'); assert.equal(moment(0).from(30000), 'před pár sekundami', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'před pár sekundami', 'now from now should display as in the past'); }); -test("fromNow (future)", function (assert) { +test('fromNow (future)', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'za pár sekund', 'in a few seconds'); assert.equal(moment().add({m: 1}).fromNow(), 'za minutu', 'in a minute'); assert.equal(moment().add({m: 3}).fromNow(), 'za 3 minuty', 'in 3 minutes'); @@ -164,7 +164,7 @@ test("fromNow (future)", function (assert) { assert.equal(moment().add({y: 10}).fromNow(), 'za 10 let', 'in 10 years'); }); -test("fromNow (past)", function (assert) { +test('fromNow (past)', function (assert) { assert.equal(moment().subtract({s: 30}).fromNow(), 'před pár sekundami', 'a few seconds ago'); assert.equal(moment().subtract({m: 1}).fromNow(), 'před minutou', 'a minute ago'); assert.equal(moment().subtract({m: 3}).fromNow(), 'před 3 minutami', '3 minutes ago'); @@ -183,7 +183,7 @@ test("fromNow (past)", function (assert) { assert.equal(moment().subtract({y: 10}).fromNow(), 'před 10 lety', '10 years ago'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'dnes v 2:00', 'today at the same time'); @@ -194,7 +194,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'včera v 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m, nextDay; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -230,7 +230,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, lastDay; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -266,7 +266,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -280,14 +280,14 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("humanize duration", function (assert) { +test('humanize duration', function (assert) { assert.equal(moment.duration(1, 'minutes').humanize(), 'minuta', 'a minute (future)'); assert.equal(moment.duration(1, 'minutes').humanize(true), 'za minutu', 'in a minute'); assert.equal(moment.duration(-1, 'minutes').humanize(), 'minuta', 'a minute (past)'); assert.equal(moment.duration(-1, 'minutes').humanize(true), 'před minutou', 'a minute ago'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -295,7 +295,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -303,7 +303,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -312,7 +312,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -321,7 +321,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -330,7 +330,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -339,7 +339,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -348,7 +348,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -356,7 +356,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -370,7 +370,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -383,7 +383,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/cv.js b/src/test/locale/cv.js index 035f87318..e2d3bdaa4 100644 --- a/src/test/locale/cv.js +++ b/src/test/locale/cv.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("cv"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('cv'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'кăрлач кăр_нарăс нар_пуш пуш_ака ака_май май_çĕртме çĕр_утă утă_çурла çур_авăн ав_юпа юпа_чӳк чӳк_раштав раш'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'вырсарникун, нарăс 14-мĕш 2010, 3:25:50 pm'], ['ddd, hA', 'выр, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-мĕш', '1-мĕш'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-мĕш', '2-мĕш'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-мĕш', '3-мĕш'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-мĕш', '31-мĕш'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'кăрлач кăр_нарăс нар_пуш пуш_ака ака_май май_çĕртме çĕр_утă утă_çурла çур_авăн ав_юпа юпа_чӳк чӳк_раштав раш'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'вырсарникун выр вр_тунтикун тун тн_ытларикун ытл ыт_юнкун юн юн_кĕçнерникун кĕç кç_эрнекун эрн эр_шăматкун шăм шм'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'пĕр-ик çеккунт', '44 sekunder = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'пĕр минут', '45 seconds = a minute'); @@ -136,23 +136,23 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 çул', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'пĕр-ик çеккунтран', 'prefix'); assert.equal(moment(0).from(30000), 'пĕр-ик çеккунт каялла', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'пĕр-ик çеккунт каялла', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'пĕр-ик çеккунтран', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 кунран', 'in 5 days'); assert.equal(moment().add({h: 2}).fromNow(), '2 сехетрен', 'in 2 hours, the right suffix!'); assert.equal(moment().add({y: 3}).fromNow(), '3 çултан', 'in 3 years, the right suffix!'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Паян 02:00 сехетре', 'today at the same time'); assert.equal(moment(a).add({m: 25}).calendar(), 'Паян 02:25 сехетре', 'Now plus 25 min'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ĕнер 02:00 сехетре', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -175,7 +175,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -188,7 +188,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -202,7 +202,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -210,7 +210,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -218,7 +218,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -227,7 +227,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -236,7 +236,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -245,7 +245,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -254,7 +254,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -263,7 +263,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-мĕш', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-мĕш', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-мĕш', 'Jan 2 2012 should be week 2'); @@ -271,7 +271,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-мĕш', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -285,7 +285,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/cy.js b/src/test/locale/cy.js index a232c8e63..f62418a32 100644 --- a/src/test/locale/cy.js +++ b/src/test/locale/cy.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("cy"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('cy'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Dydd Sul, Chwefror 14eg 2010, 3:25:50 pm'], ['ddd, hA', 'Sul, 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1af', '1af'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2il', '2il'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3ydd', '3ydd'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ain', '31ain'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Dydd Sul Sul Su_Dydd Llun Llun Ll_Dydd Mawrth Maw Ma_Dydd Mercher Mer Me_Dydd Iau Iau Ia_Dydd Gwener Gwe Gw_Dydd Sadwrn Sad Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ychydig eiliadau', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'munud', '45 seconds = a minute'); @@ -137,17 +137,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 flynedd', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'mewn ychydig eiliadau', 'prefix'); assert.equal(moment(0).from(30000), 'ychydig eiliadau yn ôl', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'mewn ychydig eiliadau', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'mewn 5 diwrnod', 'in 5 days'); }); -test("same day", function (assert) { +test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Heddiw am 02:00', 'today at the same time'); @@ -158,7 +158,7 @@ test("same day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ddoe am 02:00', 'yesterday at the same time'); }); -test("same next week", function (assert) { +test('same next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -171,7 +171,7 @@ test("same next week", function (assert) { } }); -test("same last week", function (assert) { +test('same last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -184,7 +184,7 @@ test("same last week", function (assert) { } }); -test("same all else", function (assert) { +test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -198,7 +198,7 @@ test("same all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -206,7 +206,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -214,7 +214,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -259,7 +259,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ain', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1af', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1af', 'Jan 8 2012 should be week 1'); @@ -267,7 +267,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2il', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -281,7 +281,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -294,7 +294,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/da.js b/src/test/locale/da.js index 666d9012e..21e4c78ed 100644 --- a/src/test/locale/da.js +++ b/src/test/locale/da.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("da"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('da'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd [den] Do MMMM YYYY, h:mm:ss a', 'søndag den 14. februar 2010, 3:25:50 pm'], ['ddd hA', 'søn 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'søndag søn sø_mandag man ma_tirsdag tir ti_onsdag ons on_torsdag tor to_fredag fre fr_lørdag lør lø'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'få sekunder', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'et minut', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'om få sekunder', 'prefix'); assert.equal(moment(0).from(30000), 'få sekunder siden', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'få sekunder siden', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'om få sekunder', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dage', 'in 5 days'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -158,7 +158,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -166,7 +166,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -175,7 +175,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -184,7 +184,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -193,7 +193,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -202,7 +202,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -211,7 +211,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -219,7 +219,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -233,7 +233,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -246,7 +246,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/de-at.js b/src/test/locale/de-at.js index 614b07de6..a2c4c680e 100644 --- a/src/test/locale/de-at.js +++ b/src/test/locale/de-at.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("de-at"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('de-at'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Jänner Jän._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; function equalTest(input, mmm, i) { @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'], ['ddd, hA', 'So., 3PM'], @@ -55,7 +55,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -92,21 +92,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Jänner Jän._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ein paar Sekunden', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eine Minute', '45 seconds = a minute'); @@ -137,17 +137,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Jahre', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in ein paar Sekunden', 'prefix'); assert.equal(moment(0).from(30000), 'vor ein paar Sekunden', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in ein paar Sekunden', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'in 5 Tagen', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Heute um 02:00 Uhr', 'today at the same time'); @@ -158,7 +158,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Gestern um 02:00 Uhr', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -170,7 +170,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -182,7 +182,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -196,7 +196,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -204,7 +204,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -212,7 +212,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -221,7 +221,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -230,7 +230,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -239,7 +239,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -248,7 +248,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -257,7 +257,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -265,7 +265,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -279,7 +279,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -292,7 +292,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/de.js b/src/test/locale/de.js index e4a3fcceb..ce2fbcd45 100644 --- a/src/test/locale/de.js +++ b/src/test/locale/de.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("de"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('de'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'], ['ddd, hA', 'So., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ein paar Sekunden', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eine Minute', '45 seconds = a minute'); @@ -136,17 +136,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Jahre', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in ein paar Sekunden', 'prefix'); assert.equal(moment(0).from(30000), 'vor ein paar Sekunden', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in ein paar Sekunden', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'in 5 Tagen', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Heute um 02:00 Uhr', 'today at the same time'); @@ -157,7 +157,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Gestern um 02:00 Uhr', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -169,7 +169,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -181,7 +181,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -195,7 +195,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -203,7 +203,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -211,7 +211,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -220,7 +220,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -229,7 +229,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -238,7 +238,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -247,7 +247,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -256,7 +256,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -264,7 +264,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -278,7 +278,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -291,7 +291,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/el.js b/src/test/locale/el.js index a213ce9c0..f3ec8c9ee 100644 --- a/src/test/locale/el.js +++ b/src/test/locale/el.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("el"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('el'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("parse meridiem", function (assert) { +test('parse meridiem', function (assert) { var i, b = moment(), meridiemTests = [ @@ -56,7 +56,7 @@ test("parse meridiem", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Κυριακή, Φεβρουάριος 14η 2010, 3:25:50 μμ'], ['dddd, D MMMM YYYY, h:mm:ss a', 'Κυριακή, 14 Φεβρουαρίου 2010, 3:25:50 μμ'], @@ -92,7 +92,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1η', '1η'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2η', '2η'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3η', '3η'); @@ -129,7 +129,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31η', '31η'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split('_'); @@ -138,7 +138,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'Κυριακή Κυρ Κυ_Δευτέρα Δευ Δε_Τρίτη Τρι Τρ_Τετάρτη Τετ Τε_Πέμπτη Πεμ Πε_Παρασκευή Παρ Πα_Σάββατο Σαβ Σα'.split('_'); @@ -147,7 +147,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'λίγα δευτερόλεπτα', '44 seconds = a few seconds'); @@ -180,21 +180,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 χρόνια', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'σε λίγα δευτερόλεπτα', 'prefix'); assert.equal(moment(0).from(30000), 'λίγα δευτερόλεπτα πριν', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'λίγα δευτερόλεπτα πριν', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'σε λίγα δευτερόλεπτα', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'σε 5 μέρες', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Σήμερα στις 2:00 ΠΜ', 'today at the same time'); @@ -205,7 +205,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Χθες στις 2:00 ΠΜ', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -217,7 +217,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, dayString; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -232,7 +232,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -246,7 +246,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -254,7 +254,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 52, 'Dec 31 2006 should be week 52'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -263,7 +263,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -272,7 +272,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 should be week 52'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -281,7 +281,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 should be week 52'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -290,7 +290,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 should be week 52'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 2]).week(), 53, 'Jan 2 2010 should be week 53'); @@ -300,7 +300,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 51, 'Dec 26 2010 should be week 51'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -309,7 +309,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52η', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1η', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1η', 'Jan 8 2012 should be week 1'); @@ -317,7 +317,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2η', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -331,7 +331,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -344,7 +344,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/en-au.js b/src/test/locale/en-au.js index 8fbc06366..ee666ce1b 100644 --- a/src/test/locale/en-au.js +++ b/src/test/locale/en-au.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("en-au"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('en-au'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'], ['ddd, hA', 'Sun, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'a minute', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 years', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'a few seconds ago', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Today at 2:00 AM', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 2:00 AM', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1st', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testStr; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -278,7 +278,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testStr; for (i = 1; i <= 31; ++i) { testStr = moment('2014 01 ' + i, 'YYYY MM Do').format('YYYY MM D'); @@ -287,7 +287,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MMM Do'); diff --git a/src/test/locale/en-ca.js b/src/test/locale/en-ca.js index bcb44f672..a9d6583ce 100644 --- a/src/test/locale/en-ca.js +++ b/src/test/locale/en-ca.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("en-ca"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('en-ca'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'], ['ddd, hA', 'Sun, 3PM'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); @@ -94,7 +94,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); @@ -103,7 +103,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'); @@ -112,7 +112,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'a minute', '45 seconds = a minute'); @@ -144,21 +144,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 years', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'a few seconds ago', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Today at 2:00 AM', 'today at the same time'); @@ -169,7 +169,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 2:00 AM', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -182,7 +182,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -195,7 +195,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -209,7 +209,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -217,7 +217,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -226,7 +226,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -244,7 +244,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -253,7 +253,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -262,7 +262,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -270,7 +270,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2nd', 'Jan 8 2012 should be week 2'); @@ -278,7 +278,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -292,7 +292,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -305,7 +305,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/en-gb.js b/src/test/locale/en-gb.js index 82a7be5a0..c308dc3c6 100644 --- a/src/test/locale/en-gb.js +++ b/src/test/locale/en-gb.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("en-gb"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('en-gb'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'], ['ddd, hA', 'Sun, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'a minute', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 years', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'a few seconds ago', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Today at 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1st', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -283,7 +283,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/en.js b/src/test/locale/en.js index 1db711e36..1eaa64c6a 100644 --- a/src/test/locale/en.js +++ b/src/test/locale/en.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("en"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('en'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'], ['ddd, hA', 'Sun, 3PM'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); @@ -94,7 +94,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'); @@ -103,7 +103,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'); @@ -112,7 +112,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'a few seconds', '44 seconds = a few seconds'); @@ -145,21 +145,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 years', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix'); assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'a few seconds ago', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Today at 2:00 AM', 'today at the same time'); @@ -170,7 +170,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at 2:00 AM', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -183,7 +183,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -196,7 +196,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -210,7 +210,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -218,7 +218,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -227,7 +227,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -236,7 +236,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -245,7 +245,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -254,7 +254,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -263,7 +263,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -271,7 +271,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2nd', 'Jan 8 2012 should be week 2'); @@ -279,7 +279,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -306,7 +306,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/eo.js b/src/test/locale/eo.js index 5793ea4ca..a595db996 100644 --- a/src/test/locale/eo.js +++ b/src/test/locale/eo.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("eo"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('eo'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Dimanĉo, februaro 14a 2010, 3:25:50 p.t.m.'], ['ddd, hA', 'Dim, 3P.T.M.'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3a', '3a'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Dimanĉo Dim Di_Lundo Lun Lu_Mardo Mard Ma_Merkredo Merk Me_Ĵaŭdo Ĵaŭ Ĵa_Vendredo Ven Ve_Sabato Sab Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'sekundoj', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuto', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaroj', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'je sekundoj', 'je prefix'); assert.equal(moment(0).from(30000), 'antaŭ sekundoj', 'antaŭ prefix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'antaŭ sekundoj', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'je sekundoj', 'je sekundoj'); assert.equal(moment().add({d: 5}).fromNow(), 'je 5 tagoj', 'je 5 tagoj'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Hodiaŭ je 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hieraŭ je 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -187,7 +187,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -201,7 +201,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -209,7 +209,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -217,7 +217,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -226,7 +226,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -244,7 +244,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -253,7 +253,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -262,7 +262,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1a', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1a', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2a', 'Jan 2 2012 should be week 2'); @@ -270,7 +270,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3a', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -284,7 +284,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -297,7 +297,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/es.js b/src/test/locale/es.js index 0b42b591c..f872dc274 100644 --- a/src/test/locale/es.js +++ b/src/test/locale/es.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("es"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('es'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'domingo, febrero 14º 2010, 3:25:50 pm'], ['ddd, hA', 'dom., 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'domingo dom. Do_lunes lun. Lu_martes mar. Ma_miércoles mié. Mi_jueves jue. Ju_viernes vie. Vi_sábado sáb. Sá'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'unos segundos', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); @@ -137,21 +137,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 años', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'en unos segundos', 'prefix'); assert.equal(moment(0).from(30000), 'hace unos segundos', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'hace unos segundos', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'en unos segundos', 'en unos segundos'); assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'hoy a las 2:00', 'today at the same time'); @@ -163,7 +163,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'ayer a las 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -176,7 +176,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -189,7 +189,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -203,7 +203,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -211,7 +211,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -219,7 +219,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -228,7 +228,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -237,7 +237,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -246,7 +246,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -255,7 +255,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -264,7 +264,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); @@ -272,7 +272,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -286,7 +286,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -299,7 +299,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/et.js b/src/test/locale/et.js index 29a766973..6b9cd855a 100644 --- a/src/test/locale/et.js +++ b/src/test/locale/et.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("et"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('et'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' peaks olema kuu ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, H:mm:ss', 'pühapäev, 14. veebruar 2010, 15:25:50'], ['ddd, h', 'P, 3'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'pühapäev P P_esmaspäev E E_teisipäev T T_kolmapäev K K_neljapäev N N_reede R R_laupäev L L'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'paar sekundit', '44 seconds = paar sekundit'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'üks minut', '45 seconds = üks minut'); @@ -136,16 +136,16 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 aastat', '5 years = 5 aastat'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'mõne sekundi pärast', 'prefix'); assert.equal(moment(0).from(30000), 'mõni sekund tagasi', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'mõni sekund tagasi', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'mõne sekundi pärast', 'in a few seconds'); assert.equal(moment().subtract({s: 30}).fromNow(), 'mõni sekund tagasi', 'a few seconds ago'); @@ -174,7 +174,7 @@ test("fromNow", function (assert) { assert.equal(moment().subtract({y: 5}).fromNow(), '5 aastat tagasi', '5 years ago'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Täna, 2:00', 'today at the same time'); @@ -185,7 +185,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Eile, 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -197,7 +197,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -209,7 +209,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -223,7 +223,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 nädala pärast'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -231,7 +231,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -239,7 +239,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -248,7 +248,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -257,7 +257,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -266,7 +266,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -275,7 +275,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -284,7 +284,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -292,7 +292,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -306,7 +306,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -319,7 +319,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/eu.js b/src/test/locale/eu.js index 5458b018c..eca8051c9 100644 --- a/src/test/locale/eu.js +++ b/src/test/locale/eu.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("eu"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('eu'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'], ['ddd, hA', 'ig., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'igandea ig. ig_astelehena al. al_asteartea ar. ar_asteazkena az. az_osteguna og. og_ostirala ol. ol_larunbata lr. lr'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundo batzuk', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutu bat', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 urte', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'segundo batzuk barru', 'prefix'); assert.equal(moment(0).from(30000), 'duela segundo batzuk', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'duela segundo batzuk', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'segundo batzuk barru', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 egun barru', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'gaur 02:00etan', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'atzo 02:00etan', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -207,7 +207,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -251,7 +251,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -260,7 +260,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -268,7 +268,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -282,7 +282,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -295,7 +295,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/fa.js b/src/test/locale/fa.js index 9f9bcd9aa..4e514d701 100644 --- a/src/test/locale/fa.js +++ b/src/test/locale/fa.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("fa"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('fa'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month()); @@ -13,7 +13,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'یک\u200cشنبه، فوریه ۱۴م ۲۰۱۰، ۳:۲۵:۵۰ بعد از ظهر'], ['ddd, hA', 'یک\u200cشنبه، ۳بعد از ظهر'], @@ -46,7 +46,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '۱م', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '۲م', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '۳م', '3'); @@ -83,21 +83,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '۳۱م', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ژانویه ژانویه_فوریه فوریه_مارس مارس_آوریل آوریل_مه مه_ژوئن ژوئن_ژوئیه ژوئیه_اوت اوت_سپتامبر سپتامبر_اکتبر اکتبر_نوامبر نوامبر_دسامبر دسامبر'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'یک\u200cشنبه یک\u200cشنبه ی_دوشنبه دوشنبه د_سه\u200cشنبه سه\u200cشنبه س_چهارشنبه چهارشنبه چ_پنج\u200cشنبه پنج\u200cشنبه پ_جمعه جمعه ج_شنبه شنبه ش'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'چندین ثانیه', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'یک دقیقه', '45 seconds = a minute'); @@ -129,21 +129,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '۵ سال', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'در چندین ثانیه', 'prefix'); assert.equal(moment(0).from(30000), 'چندین ثانیه پیش', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'چندین ثانیه پیش', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'در چندین ثانیه', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'در ۵ روز', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'امروز ساعت ۰۲:۰۰', 'today at the same time'); @@ -154,7 +154,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'دیروز ساعت ۰۲:۰۰', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -166,7 +166,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -178,7 +178,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -192,7 +192,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); @@ -200,7 +200,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); @@ -208,7 +208,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); @@ -217,7 +217,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); @@ -226,7 +226,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); @@ -243,7 +243,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); @@ -251,7 +251,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '۱ ۰۱ ۱م', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '۱ ۰۱ ۱م', 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 7 2012 should be week 2'); @@ -259,7 +259,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '۳ ۰۳ ۳م', 'Jan 14 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -273,7 +273,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -286,7 +286,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/fi.js b/src/test/locale/fi.js index 143c41f7c..cb38bd6d1 100644 --- a/src/test/locale/fi.js +++ b/src/test/locale/fi.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("fi"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('fi'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'sunnuntai, helmikuu 14. 2010, 3:25:50 pm'], ['ddd, hA', 'su, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3rd'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'sunnuntai su su_maanantai ma ma_tiistai ti ti_keskiviikko ke ke_torstai to to_perjantai pe pe_lauantai la la'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'muutama sekunti', '44 seconds = few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuutti', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'viisi vuotta', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'muutaman sekunnin päästä', 'prefix'); assert.equal(moment(0).from(30000), 'muutama sekunti sitten', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'muutama sekunti sitten', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'muutaman sekunnin päästä', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'viiden päivän päästä', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'tänään klo 02.00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'eilen klo 02.00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'kaden viikon päästä'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -283,7 +283,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/fo.js b/src/test/locale/fo.js index ffb3c17ce..51832418f 100644 --- a/src/test/locale/fo.js +++ b/src/test/locale/fo.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("fo"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('fo'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd [tann] Do MMMM YYYY, h:mm:ss a', 'sunnudagur tann 14. februar 2010, 3:25:50 pm'], ['ddd hA', 'sun 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'sunnudagur sun su_mánadagur mán má_týsdagur týs tý_mikudagur mik mi_hósdagur hós hó_fríggjadagur frí fr_leygardagur ley le'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'fá sekund', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ein minutt', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ár', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'um fá sekund', 'prefix'); assert.equal(moment(0).from(30000), 'fá sekund síðani', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'fá sekund síðani', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'um fá sekund', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'um 5 dagar', 'in 5 days'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -158,7 +158,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -166,7 +166,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -175,7 +175,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -184,7 +184,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -193,7 +193,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -202,7 +202,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -211,7 +211,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -219,7 +219,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -233,7 +233,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -246,7 +246,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/fr-ca.js b/src/test/locale/fr-ca.js index 8cb3d9fee..860cccc47 100644 --- a/src/test/locale/fr-ca.js +++ b/src/test/locale/fr-ca.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("fr-ca"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('fr-ca'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14 2010, 3:25:50 pm'], ['ddd, hA', 'dim., 3PM'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -94,7 +94,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'); @@ -103,7 +103,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'); @@ -112,7 +112,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); @@ -145,17 +145,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); }); -test("same day", function (assert) { +test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); @@ -166,7 +166,7 @@ test("same day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); }); -test("same next week", function (assert) { +test('same next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -179,7 +179,7 @@ test("same next week", function (assert) { } }); -test("same last week", function (assert) { +test('same last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -192,7 +192,7 @@ test("same last week", function (assert) { } }); -test("same all else", function (assert) { +test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -206,7 +206,7 @@ test("same all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -214,7 +214,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -267,7 +267,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1er', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1er', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); @@ -275,7 +275,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -289,7 +289,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -302,7 +302,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/fr.js b/src/test/locale/fr.js index b97dcbd90..ff36276c6 100644 --- a/src/test/locale/fr.js +++ b/src/test/locale/fr.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("fr"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('fr'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14 2010, 3:25:50 pm'], ['ddd, hA', 'dim., 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'quelques secondes', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'une minute', '45 seconds = a minute'); @@ -137,17 +137,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ans', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix'); assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days'); }); -test("same day", function (assert) { +test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Aujourd\'hui à 02:00', 'today at the same time'); @@ -158,7 +158,7 @@ test("same day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hier à 02:00', 'yesterday at the same time'); }); -test("same next week", function (assert) { +test('same next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -171,7 +171,7 @@ test("same next week", function (assert) { } }); -test("same last week", function (assert) { +test('same last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -184,7 +184,7 @@ test("same last week", function (assert) { } }); -test("same all else", function (assert) { +test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -198,7 +198,7 @@ test("same all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -206,7 +206,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -214,7 +214,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -259,7 +259,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1er', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1er', 'Jan 8 2012 should be week 1'); @@ -267,7 +267,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -281,7 +281,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -294,7 +294,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/fy.js b/src/test/locale/fy.js index 7110bb438..0ab22d736 100644 --- a/src/test/locale/fy.js +++ b/src/test/locale/fy.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("fy"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('fy'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai._juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, HH:mm:ss', 'snein, febrewaris 14de 2010, 15:25:50'], ['ddd, HH', 'si., 15'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai_juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'snein si. Si_moandei mo. Mo_tiisdei ti. Ti_woansdei wo. Wo_tongersdei to. To_freed fr. Fr_sneon so. So'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'in pear sekonden', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ien minút', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jierren', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'oer in pear sekonden', 'prefix'); assert.equal(moment(0).from(30000), 'in pear sekonden lyn', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'in pear sekonden lyn', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'oer in pear sekonden', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'oer 5 dagen', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'hjoed om 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'juster om 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,12 +199,12 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("month abbreviation", function (assert) { +test('month abbreviation', function (assert) { assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot'); assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -212,7 +212,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -220,7 +220,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -229,7 +229,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -238,7 +238,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -247,7 +247,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -256,7 +256,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -265,7 +265,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); @@ -273,7 +273,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -287,7 +287,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -300,7 +300,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/gl.js b/src/test/locale/gl.js index 58134b1cb..92986f6ac 100644 --- a/src/test/locale/gl.js +++ b/src/test/locale/gl.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("gl"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('gl'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Febreiro 14º 2010, 3:25:50 pm'], ['ddd, hA', 'Dom., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); @@ -90,14 +90,14 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Domingo Dom. Do_Luns Lun. Lu_Martes Mar. Ma_Mércores Mér. Mé_Xoves Xov. Xo_Venres Ven. Ve_Sábado Sáb. Sá'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -105,7 +105,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'uns segundos', '44 seconds = a few seconds'); @@ -138,21 +138,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'nuns segundos', 'prefix'); assert.equal(moment(0).from(30000), 'hai uns segundos', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'hai uns segundos', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'nuns segundos', 'en unos segundos'); assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'hoxe ás 2:00', 'today at the same time'); @@ -164,7 +164,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'onte á 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -177,7 +177,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -189,7 +189,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -203,12 +203,12 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("regression tests", function (assert) { +test('regression tests', function (assert) { var lastWeek = moment().subtract({d: 4}).hours(1); assert.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), '1 o\'clock bug'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -224,7 +224,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -251,7 +251,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -260,7 +260,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1º', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2º', 'Jan 2 2012 should be week 2'); @@ -277,7 +277,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3º', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -291,7 +291,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -304,7 +304,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/he.js b/src/test/locale/he.js index c96c487ef..5c3bbcf92 100644 --- a/src/test/locale/he.js +++ b/src/test/locale/he.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("he"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('he'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'ראשון, פברואר 14 2010, 3:25:50 pm'], ['ddd, hA', 'א׳, 3PM'], @@ -53,21 +53,21 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'ראשון א׳ א|שני ב׳ ב|שלישי ג׳ ג|רביעי ד׳ ד|חמישי ה׳ ה|שישי ו׳ ו|שבת ש׳ ש'.split('|'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'מספר שניות', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'דקה', '45 seconds = a minute'); @@ -101,21 +101,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 שנים', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'בעוד מספר שניות', 'prefix'); assert.equal(moment(0).from(30000), 'לפני מספר שניות', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'לפני מספר שניות', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'בעוד מספר שניות', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'בעוד 5 ימים', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'היום ב־02:00', 'today at the same time'); @@ -126,7 +126,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'אתמול ב־02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -138,7 +138,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -150,7 +150,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -164,7 +164,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -172,7 +172,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -181,7 +181,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -190,7 +190,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -199,7 +199,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -217,7 +217,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -225,7 +225,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); @@ -233,7 +233,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -247,7 +247,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -260,7 +260,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/hi.js b/src/test/locale/hi.js index de05aedba..1555a4b94 100644 --- a/src/test/locale/hi.js +++ b/src/test/locale/hi.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("hi"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('hi'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, a h:mm:ss बजे', 'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५:५० बजे'], ['ddd, a h बजे', 'रवि, दोपहर ३ बजे'], @@ -52,7 +52,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); @@ -89,21 +89,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'रविवार रवि र_सोमवार सोम सो_मंगलवार मंगल मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'कुछ ही क्षण', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनट', '45 seconds = a minute'); @@ -135,21 +135,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्ष', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'कुछ ही क्षण में', 'prefix'); assert.equal(moment(0).from(30000), 'कुछ ही क्षण पहले', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'कुछ ही क्षण पहले', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'कुछ ही क्षण में', 'कुछ ही क्षण में'); assert.equal(moment().add({d: 5}).fromNow(), '५ दिन में', '५ दिन में'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'आज रात २:०० बजे', 'today at the same time'); @@ -160,7 +160,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'कल रात २:०० बजे', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -172,7 +172,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सुबह', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दोपहर', 'during day'); @@ -215,7 +215,7 @@ test("meridiem invariant", function (assert) { assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -276,7 +276,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); @@ -284,7 +284,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -311,7 +311,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -323,7 +323,7 @@ test("meridiem", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/hr.js b/src/test/locale/hr.js index 77478042f..212cec6fe 100644 --- a/src/test/locale/hr.js +++ b/src/test/locale/hr.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("hr"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('hr'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'sječanj sje._veljača vel._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedjelja, 14. veljača 2010, 3:25:50 pm'], ['ddd, hA', 'ned., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'sječanj sje._veljača vel._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'par sekundi', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedna minuta', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'za par sekundi', 'prefix'); assert.equal(moment(0).from(30000), 'prije par sekundi', 'prefix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'prije par sekundi', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'za par sekundi', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'jučer u 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { @@ -190,7 +190,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -218,7 +218,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -232,7 +232,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -240,7 +240,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -248,7 +248,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -257,7 +257,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -266,7 +266,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -275,7 +275,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -284,7 +284,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -293,7 +293,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -301,7 +301,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -315,7 +315,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -328,7 +328,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/hu.js b/src/test/locale/hu.js index 696691f65..9b1c9b1f2 100644 --- a/src/test/locale/hu.js +++ b/src/test/locale/hu.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("hu"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('hu'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, HH:mm:ss', 'vasárnap, február 14. 2010, 15:25:50'], ['ddd, HH', 'vas, 15'], @@ -52,7 +52,7 @@ test("format", function (assert) { } }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 0]).format('a'), 'de', 'am'); assert.equal(moment([2011, 2, 23, 11, 59]).format('a'), 'de', 'am'); assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), 'du', 'pm'); @@ -64,7 +64,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 23, 59]).format('A'), 'DU', 'PM'); }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -101,7 +101,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -109,7 +109,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'vasárnap vas_hétfő hét_kedd kedd_szerda sze_csütörtök csüt_péntek pén_szombat szo'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -117,7 +117,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'néhány másodperc', '44 másodperc = néhány másodperc'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'egy perc', '45 másodperc = egy perc'); @@ -149,21 +149,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 év', '5 év = 5 év'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'néhány másodperc múlva', 'prefix'); assert.equal(moment(0).from(30000), 'néhány másodperce', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'néhány másodperce', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'néhány másodperc múlva', 'néhány másodperc múlva'); assert.equal(moment().add({d: 5}).fromNow(), '5 nap múlva', '5 nap múlva'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'ma 2:00-kor', 'today at the same time'); @@ -174,7 +174,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'tegnap 2:00-kor', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_'); for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -186,7 +186,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_'); for (i = 2; i < 7; i++) { @@ -199,7 +199,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -213,7 +213,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 hét múlva'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -221,7 +221,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -229,7 +229,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -238,7 +238,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -247,7 +247,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -256,7 +256,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -265,7 +265,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -274,7 +274,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -282,7 +282,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -309,7 +309,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/hy-am.js b/src/test/locale/hy-am.js index 50a09cc50..02ba21403 100644 --- a/src/test/locale/hy-am.js +++ b/src/test/locale/hy-am.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("hy-am"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('hy-am'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,11 +20,11 @@ test("parse", function (assert) { } }); -test("parse exceptional case", function (assert) { +test('parse exceptional case', function (assert) { assert.equal(moment('11 մայիսի 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989'); }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, HH:mm:ss', 'կիրակի, 14 փետրվարի 2010, 15:25:50'], ['ddd, h A', 'կրկ, 3 ցերեկվա'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format meridiem", function (assert) { +test('format meridiem', function (assert) { assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'գիշերվա', 'night'); assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'գիշերվա', 'night'); assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'առավոտվա', 'morning'); @@ -68,7 +68,7 @@ test("format meridiem", function (assert) { assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'երեկոյան', 'evening'); }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ին', '1-ին'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-րդ', '2-րդ'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-րդ', '3-րդ'); @@ -105,14 +105,14 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-րդ', '31-րդ'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format month case", function (assert) { +test('format month case', function (assert) { var months = { 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') @@ -123,7 +123,7 @@ test("format month case", function (assert) { } }); -test("format month short case", function (assert) { +test('format month short case', function (assert) { var monthsShort = { 'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), 'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_') @@ -134,7 +134,7 @@ test("format month short case", function (assert) { } }); -test("format month case with escaped symbols", function (assert) { +test('format month case with escaped symbols', function (assert) { var months = { 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') @@ -147,7 +147,7 @@ test("format month case with escaped symbols", function (assert) { } }); -test("format month short case with escaped symbols", function (assert) { +test('format month short case with escaped symbols', function (assert) { var monthsShort = { 'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), 'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_') @@ -160,14 +160,14 @@ test("format month short case with escaped symbols", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'կիրակի կրկ կրկ_երկուշաբթի երկ երկ_երեքշաբթի երք երք_չորեքշաբթի չրք չրք_հինգշաբթի հնգ հնգ_ուրբաթ ուրբ ուրբ_շաբաթ շբթ շբթ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'մի քանի վայրկյան', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'րոպե', '45 seconds = a minute'); @@ -201,17 +201,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 տարի', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'մի քանի վայրկյան հետո', 'prefix'); assert.equal(moment(0).from(30000), 'մի քանի վայրկյան առաջ', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'մի քանի վայրկյան հետո', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 օր հետո', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'այսօր 02:00', 'today at the same time'); @@ -222,7 +222,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'երեկ 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { return 'dddd [օրը ժամը] LT'; @@ -238,7 +238,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -255,7 +255,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -269,7 +269,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -277,7 +277,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -285,7 +285,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -294,7 +294,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -303,7 +303,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -312,7 +312,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -321,7 +321,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -330,7 +330,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ին', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ին', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-րդ', 'Jan 2 2012 should be week 2'); @@ -338,7 +338,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-րդ', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -352,7 +352,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -365,7 +365,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/id.js b/src/test/locale/id.js index 084527e21..fa3f22eb4 100644 --- a/src/test/locale/id.js +++ b/src/test/locale/id.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("id"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('id'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Minggu, Februari 14 2010, 3:25:50 sore'], ['ddd, hA', 'Min, 3sore'], @@ -53,21 +53,21 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Minggu Min Mg_Senin Sen Sn_Selasa Sel Sl_Rabu Rab Rb_Kamis Kam Km_Jumat Jum Jm_Sabtu Sab Sb'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa detik', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'semenit', '45 seconds = a minute'); @@ -99,21 +99,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'dalam beberapa detik', 'prefix'); assert.equal(moment(0).from(30000), 'beberapa detik yang lalu', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'beberapa detik yang lalu', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa detik', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'today at the same time'); @@ -124,7 +124,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kemarin pukul 02.00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -136,7 +136,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -148,7 +148,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -162,7 +162,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -170,7 +170,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -178,7 +178,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -187,7 +187,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -196,7 +196,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -205,7 +205,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -214,7 +214,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); @@ -231,7 +231,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -245,7 +245,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -258,7 +258,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -270,7 +270,7 @@ test("meridiem invariant", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/is.js b/src/test/locale/is.js index 4d1633c3f..1f1dba7df 100644 --- a/src/test/locale/is.js +++ b/src/test/locale/is.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("is"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('is'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'sunnudagur, 14. febrúar 2010, 3:25:50 pm'], ['ddd, hA', 'sun, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'sunnudagur sun Su_mánudagur mán Má_þriðjudagur þri Þr_miðvikudagur mið Mi_fimmtudagur fim Fi_föstudagur fös Fö_laugardagur lau La'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nokkrar sekúndur', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'mínúta', '45 seconds = a minute'); @@ -140,23 +140,23 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 21}), true), '21 ár', '21 years = 21 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'eftir nokkrar sekúndur', 'prefix'); assert.equal(moment(0).from(30000), 'fyrir nokkrum sekúndum síðan', 'suffix'); assert.equal(moment().subtract({m: 1}).fromNow(), 'fyrir mínútu síðan', 'a minute ago'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'fyrir nokkrum sekúndum síðan', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'eftir nokkrar sekúndur', 'in a few seconds'); assert.equal(moment().add({m: 1}).fromNow(), 'eftir mínútu', 'in a minute'); assert.equal(moment().add({d: 5}).fromNow(), 'eftir 5 daga', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'í dag kl. 2:00', 'today at the same time'); @@ -167,7 +167,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'í gær kl. 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -179,7 +179,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -192,7 +192,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -206,7 +206,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -214,7 +214,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -222,7 +222,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -231,7 +231,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -240,7 +240,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -249,7 +249,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -258,7 +258,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -267,7 +267,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -275,7 +275,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -289,7 +289,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -302,7 +302,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/it.js b/src/test/locale/it.js index 1fd132228..d086dfee1 100644 --- a/src/test/locale/it.js +++ b/src/test/locale/it.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("it"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('it'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, febbraio 14º 2010, 3:25:50 pm'], ['ddd, hA', 'Dom, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Domenica Dom D_Lunedì Lun L_Martedì Mar Ma_Mercoledì Mer Me_Giovedì Gio G_Venerdì Ven V_Sabato Sab S'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'alcuni secondi', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); @@ -136,17 +136,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anni', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'in alcuni secondi', 'prefix'); assert.equal(moment(0).from(30000), 'alcuni secondi fa', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'in alcuni secondi', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'tra 5 giorni', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Oggi alle 02:00', 'today at the same time'); @@ -157,7 +157,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ieri alle 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -169,7 +169,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, weekday, datestring; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -184,7 +184,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -198,7 +198,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -206,7 +206,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -214,7 +214,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -259,7 +259,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); @@ -267,7 +267,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -281,7 +281,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -294,7 +294,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ja.js b/src/test/locale/ja.js index e73369cc8..3892d336a 100644 --- a/src/test/locale/ja.js +++ b/src/test/locale/ja.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ja"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ja'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14 2010, 午後 3:25:50'], ['ddd, Ah', '日, 午後3'], @@ -53,21 +53,21 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = '日曜日 日 日_月曜日 月 月_火曜日 火 火_水曜日 水 水_木曜日 木 木_金曜日 金 金_土曜日 土 土'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '数秒', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1分', '45 seconds = a minute'); @@ -99,21 +99,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5年', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), '数秒後', 'prefix'); assert.equal(moment(0).from(30000), '数秒前', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), '数秒前', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), '数秒後', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5日後', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), '今日 午前2時0分', 'today at the same time'); @@ -124,7 +124,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), '昨日 午前2時0分', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -136,7 +136,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -148,7 +148,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -162,7 +162,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -170,7 +170,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -179,7 +179,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -188,7 +188,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -197,7 +197,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -206,7 +206,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -215,7 +215,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); @@ -231,7 +231,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -245,7 +245,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -258,7 +258,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ka.js b/src/test/locale/ka.js index 40a59598a..15f059b80 100644 --- a/src/test/locale/ka.js +++ b/src/test/locale/ka.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ka"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ka'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'კვირა, თებერვალი მე-14 2010, 3:25:50 pm'], ['ddd, hA', 'კვი, 3PM'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ლი', '1-ლი'); assert.equal(moment([2011, 0, 2]).format('DDDo'), 'მე-2', 'მე-2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), 'მე-3', 'მე-3'); @@ -98,7 +98,7 @@ test("format ordinal", function (assert) { assert.equal(moment('2011 101', 'YYYY DDD').format('DDDo'), '101-ე', '101-ე'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_'); @@ -107,7 +107,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'კვირა კვი კვ_ორშაბათი ორშ ორ_სამშაბათი სამ სა_ოთხშაბათი ოთხ ოთ_ხუთშაბათი ხუთ ხუ_პარასკევი პარ პა_შაბათი შაბ შა'.split('_'); @@ -116,7 +116,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'რამდენიმე წამი', '44 წამი = რამდენიმე წამი'); @@ -149,21 +149,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 წელი', '5 წელი = 5 წელი'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'რამდენიმე წამში', 'ში სუფიქსი'); assert.equal(moment(0).from(30000), 'რამდენიმე წამის წინ', 'წინ სუფიქსი'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'რამდენიმე წამის წინ', 'უნდა აჩვენოს როგორც წარსული'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'რამდენიმე წამში', 'რამდენიმე წამში'); assert.equal(moment().add({d: 5}).fromNow(), '5 დღეში', '5 დღეში'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'დღეს 2:00 AM-ზე', 'დღეს ამავე დროს'); @@ -174,7 +174,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'გუშინ 2:00 AM-ზე', 'გუშინ ამავე დროს'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -186,7 +186,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -198,7 +198,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -212,7 +212,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 კვირაში'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'დეკ 26 2011 უნდა იყოს კვირა 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'იან 1 2012 უნდა იყოს კვირა 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'იან 2 2012 უნდა იყოს კვირა 2'); @@ -220,7 +220,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'იან 9 2012 უნდა იყოს კვირა 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'იან 1 2007 უნდა იყოს კვირა 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'იან 7 2007 უნდა იყოს კვირა 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'იან 8 2007 უნდა იყოს კვირა 2'); @@ -228,7 +228,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'იან 15 2007 უნდა იყოს კვირა 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'დეკ 31 2007 უნდა იყოს კვირა 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'იან 1 2008 უნდა იყოს კვირა 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'იან 6 2008 უნდა იყოს კვირა 1'); @@ -237,7 +237,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'იან 14 2008 უნდა იყოს კვირა 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'დეკ 30 2002 უნდა იყოს კვირა 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'იან 1 2003 უნდა იყოს კვირა 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'იან 5 2003 უნდა იყოს კვირა 1'); @@ -246,7 +246,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'იან 13 2003 უნდა იყოს კვირა 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'დეკ 29 2008 უნდა იყოს კვირა 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'იან 1 2009 უნდა იყოს კვირა 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'იან 4 2009 უნდა იყოს კვირა 1'); @@ -255,7 +255,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'იან 12 2009 უნდა იყოს კვირა 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'დეკ 28 2009 უნდა იყოს კვირა 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'იან 1 2010 უნდა იყოს კვირა 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'იან 3 2010 უნდა იყოს კვირა 1'); @@ -264,7 +264,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'იან 11 2010 უნდა იყოს კვირა 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'დეკ 27 2010 უნდა იყოს კვირა 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'იან 1 2011 უნდა იყოს კვირა 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'იან 2 2011 უნდა იყოს კვირა 1'); @@ -273,7 +273,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'იან 10 2011 უნდა იყოს კვირა 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ლი', 'დეკ 26 2011 უნდა იყოს კვირა 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ლი', 'იან 1 2012 უნდა იყოს კვირა 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 მე-2', 'იან 2 2012 უნდა იყოს კვირა 2'); @@ -281,7 +281,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 მე-3', 'იან 9 2012 უნდა იყოს კვირა 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -295,7 +295,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -308,7 +308,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/km.js b/src/test/locale/km.js index d67f6c45d..87b3a5308 100644 --- a/src/test/locale/km.js +++ b/src/test/locale/km.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("km"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('km'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'), i; @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'អាទិត្យ, កុម្ភៈ 14 2010, 3:25:50 pm'], ['ddd, hA', 'អាទិត្យ, 3PM'], @@ -55,7 +55,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3rd'); @@ -92,7 +92,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -100,7 +100,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'អាទិត្យ អាទិត្យ អាទិត្យ_ច័ន្ទ ច័ន្ទ ច័ន្ទ_អង្គារ អង្គារ អង្គារ_ពុធ ពុធ ពុធ_ព្រហស្បតិ៍ ព្រហស្បតិ៍ ព្រហស្បតិ៍_សុក្រ សុក្រ សុក្រ_សៅរ៍ សៅរ៍ សៅរ៍'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -108,7 +108,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ប៉ុន្មានវិនាទី', '44 seconds = ប៉ុន្មានវិនាទី'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'មួយនាទី', '45 seconds = មួយនាទី'); @@ -140,16 +140,16 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ឆ្នាំ', '5 years = 5 ឆ្នាំ'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'ប៉ុន្មានវិនាទីទៀត', 'prefix'); assert.equal(moment(0).from(30000), 'ប៉ុន្មានវិនាទីមុន', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'ប៉ុន្មានវិនាទីមុន', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({ s: 30 }).fromNow(), 'ប៉ុន្មានវិនាទីទៀត', 'in a few seconds'); @@ -158,7 +158,7 @@ test("fromNow", function (assert) { }).fromNow(), '5 ថ្ងៃទៀត', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'ថ្ងៃនៈ ម៉ោង 02:00', 'today at the same time'); @@ -179,7 +179,7 @@ test("calendar day", function (assert) { }).calendar(), 'ម្សិលមិញ ម៉ោង 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({ @@ -193,7 +193,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -208,7 +208,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({ w: 1 }), @@ -230,7 +230,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -238,7 +238,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -246,7 +246,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -255,7 +255,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -264,7 +264,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -273,7 +273,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -282,7 +282,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -291,7 +291,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1'); @@ -299,7 +299,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -313,7 +313,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -326,7 +326,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ko.js b/src/test/locale/ko.js index 2b2098cf9..d30092819 100644 --- a/src/test/locale/ko.js +++ b/src/test/locale/ko.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ko"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ko'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("parse meridiem", function (assert) { +test('parse meridiem', function (assert) { var elements = [{ expression : '1981년 9월 8일 오후 2시 30분', inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]', @@ -56,7 +56,7 @@ test("parse meridiem", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'], ['ddd A h', '일 오후 3'], @@ -89,7 +89,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일'); @@ -126,21 +126,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = '일요일 일 일_월요일 월 월_화요일 화 화_수요일 수 수_목요일 목 목_금요일 금 금_토요일 토 토'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '몇초', '44초 = 몇초'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '일분', '45초 = 일분'); @@ -172,21 +172,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5년', '5년 = 5년'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), '몇초 후', 'prefix'); assert.equal(moment(0).from(30000), '몇초 전', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), '몇초 전', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), '몇초 후', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5일 후', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), '오늘 오전 2시 0분', 'today at the same time'); @@ -197,7 +197,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), '어제 오전 2시 0분', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -209,7 +209,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -221,7 +221,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -235,7 +235,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -243,7 +243,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -252,7 +252,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -261,7 +261,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -270,7 +270,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -279,7 +279,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -288,7 +288,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -296,7 +296,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1일', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1일', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2일', 'Jan 8 2012 should be week 2'); @@ -304,7 +304,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3일', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -318,7 +318,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -331,7 +331,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/lb.js b/src/test/locale/lb.js index 750211a69..a44d0342d 100644 --- a/src/test/locale/lb.js +++ b/src/test/locale/lb.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("lb"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('lb'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; function equalTest(input, mmm, i) { @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, HH:mm:ss', 'Sonndeg, 14. Februar 2010, 15:25:50'], ['ddd, HH:mm', 'So., 15:25'], @@ -55,21 +55,21 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Sonndeg So. So_Méindeg Mé. Mé_Dënschdeg Dë. Dë_Mëttwoch Më. Më_Donneschdeg Do. Do_Freideg Fr. Fr_Samschdeg Sa. Sa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'e puer Sekonnen', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eng Minutt', '45 seconds = a minute'); @@ -101,12 +101,12 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Joer', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'an e puer Sekonnen', 'prefix'); assert.equal(moment(0).from(30000), 'virun e puer Sekonnen', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'an e puer Sekonnen', 'in a few seconds'); assert.equal(moment().add({d: 1}).fromNow(), 'an engem Dag', 'in one day'); assert.equal(moment().add({d: 2}).fromNow(), 'an 2 Deeg', 'in 2 days'); @@ -122,7 +122,7 @@ test("fromNow", function (assert) { assert.equal(moment().add({y: 400}).fromNow(), 'a 400 Joer', 'in 400 years'); }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, weekday, datestring; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -139,7 +139,7 @@ test("calendar last week", function (assert) { } }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -153,7 +153,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -166,7 +166,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/lt.js b/src/test/locale/lt.js index 2e58bace0..b89dd213a 100644 --- a/src/test/locale/lt.js +++ b/src/test/locale/lt.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("lt"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('lt'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'sausio sau_vasario vas_kovo kov_balandžio bal_gegužės geg_birželio bir_liepos lie_rugpjūčio rgp_rugsėjo rgs_spalio spa_lapkričio lap_gruodžio grd'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'sekmadienis, 14-oji vasario 2010, 3:25:50 pm'], ['ddd, hA', 'Sek, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-oji', '1-oji'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-oji', '2-oji'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-oji', '3-oji'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-oji', '31-oji'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'sausio sau_vasario vas_kovo kov_balandžio bal_gegužės geg_birželio bir_liepos lie_rugpjūčio rgp_rugsėjo rgs_spalio spa_lapkričio lap_gruodžio grd'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("format week on US calendar", function (assert) { +test('format week on US calendar', function (assert) { // Tests, whether the weekday names are correct, even if the week does not start on Monday moment.locale('lt', {week: {dow: 0, doy: 6}}); var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i; @@ -114,7 +114,7 @@ test("format week on US calendar", function (assert) { moment.locale('lt', {week: {dow: 1, doy: 4}}); }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'kelios sekundės', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutė', '45 seconds = a minute'); @@ -153,21 +153,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 metai', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'po kelių sekundžių', 'prefix'); assert.equal(moment(0).from(30000), 'prieš kelias sekundes', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'prieš kelias sekundes', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'po kelių sekundžių', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'po 5 dienų', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Šiandien 02:00', 'today at the same time'); @@ -178,7 +178,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Vakar 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -190,7 +190,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -202,7 +202,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -216,7 +216,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -232,7 +232,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -268,7 +268,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -277,7 +277,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52-oji', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1-oji', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1-oji', 'Jan 8 2012 should be week 1'); @@ -285,7 +285,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2-oji', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -299,7 +299,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -312,7 +312,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/lv.js b/src/test/locale/lv.js index 599386034..83924e008 100644 --- a/src/test/locale/lv.js +++ b/src/test/locale/lv.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("lv"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('lv'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'svētdiena, 14. februāris 2010, 3:25:50 pm'], ['ddd, hA', 'Sv, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'svētdiena Sv Sv_pirmdiena P P_otrdiena O O_trešdiena T T_ceturtdiena C C_piektdiena Pk Pk_sestdiena S S'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'dažas sekundes', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minūti', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 gadi', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'dažas sekundes vēlāk', 'prefix'); assert.equal(moment(0).from(30000), 'dažas sekundes agrāk', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'dažas sekundes agrāk', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'dažas sekundes vēlāk', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 dienas vēlāk', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Šodien pulksten 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Vakar pulksten 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -207,7 +207,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -251,7 +251,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -260,7 +260,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -282,7 +282,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -295,7 +295,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/mk.js b/src/test/locale/mk.js index e84fab3a2..f17466024 100644 --- a/src/test/locale/mk.js +++ b/src/test/locale/mk.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("mk"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('mk'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, H:mm:ss', 'недела, февруари 14-ти 2010, 15:25:50'], ['ddd, hA', 'нед, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ви', '1-ви'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ри', '2-ри'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ти', '3-ти'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ви', '31-ви'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'недела нед нe_понеделник пон пo_вторник вто вт_среда сре ср_четврток чет че_петок пет пе_сабота саб сa'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'неколку секунди', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 години', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'после неколку секунди', 'prefix'); assert.equal(moment(0).from(30000), 'пред неколку секунди', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'пред неколку секунди', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'после неколку секунди', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'после 5 дена', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Денес во 2:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера во 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -200,7 +200,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -214,7 +214,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -222,7 +222,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -230,7 +230,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -239,7 +239,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -248,7 +248,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -257,7 +257,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -266,7 +266,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -275,7 +275,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ви', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-ри', 'Jan 2 2012 should be week 2'); @@ -283,7 +283,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -297,7 +297,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -310,7 +310,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ml.js b/src/test/locale/ml.js index a365cdac7..4b9e6936e 100644 --- a/src/test/locale/ml.js +++ b/src/test/locale/ml.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ml"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ml'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, a h:mm:ss -നു', 'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'], ['ddd, a h -നു', 'ഞായർ, ഉച്ച കഴിഞ്ഞ് 3 -നു'], @@ -52,7 +52,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -89,21 +89,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'ഞായറാഴ്ച ഞായർ ഞാ_തിങ്കളാഴ്ച തിങ്കൾ തി_ചൊവ്വാഴ്ച ചൊവ്വ ചൊ_ബുധനാഴ്ച ബുധൻ ബു_വ്യാഴാഴ്ച വ്യാഴം വ്യാ_വെള്ളിയാഴ്ച വെള്ളി വെ_ശനിയാഴ്ച ശനി ശ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'അൽപ നിമിഷങ്ങൾ', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ഒരു മിനിറ്റ്', '45 seconds = a minute'); @@ -135,21 +135,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 വർഷം', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'prefix'); assert.equal(moment(0).from(30000), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്'); assert.equal(moment().add({d: 5}).fromNow(), '5 ദിവസം കഴിഞ്ഞ്', '5 ദിവസം കഴിഞ്ഞ്'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'ഇന്ന് രാത്രി 2:00 -നു', 'today at the same time'); @@ -160,7 +160,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'ഇന്നലെ രാത്രി 2:00 -നു', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -172,7 +172,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'രാത്രി', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'രാവിലെ', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ഉച്ച കഴിഞ്ഞ്', 'during day'); @@ -215,7 +215,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'രാത്രി', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -276,7 +276,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); @@ -284,7 +284,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -311,7 +311,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/mr.js b/src/test/locale/mr.js index 7e8f69f1e..edfa725eb 100644 --- a/src/test/locale/mr.js +++ b/src/test/locale/mr.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("mr"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('mr'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, a h:mm:ss वाजता', 'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५:५० वाजता'], ['ddd, a h वाजता', 'रवि, दुपारी ३ वाजता'], @@ -52,7 +52,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); @@ -89,21 +89,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'रविवार रवि र_सोमवार सोम सो_मंगळवार मंगळ मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'सेकंद', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनिट', '45 seconds = a minute'); @@ -135,21 +135,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्षे', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'सेकंद नंतर', 'prefix'); assert.equal(moment(0).from(30000), 'सेकंद पूर्वी', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'सेकंद पूर्वी', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'सेकंद नंतर', 'सेकंद नंतर'); assert.equal(moment().add({d: 5}).fromNow(), '५ दिवस नंतर', '५ दिवस नंतर'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'आज रात्री २:०० वाजता', 'today at the same time'); @@ -160,7 +160,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'काल रात्री २:०० वाजता', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -172,7 +172,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात्री', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सकाळी', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दुपारी', 'during day'); @@ -215,7 +215,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात्री', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -276,7 +276,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2'); @@ -284,7 +284,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -311,7 +311,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -323,7 +323,7 @@ test("meridiem invariant", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ms-my.js b/src/test/locale/ms-my.js index 1237d0a9f..ca64a0e72 100644 --- a/src/test/locale/ms-my.js +++ b/src/test/locale/ms-my.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ms-my"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ms-my'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Ahad, Februari 14 2010, 3:25:50 petang'], ['ddd, hA', 'Ahd, 3petang'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -94,7 +94,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_'); @@ -103,7 +103,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'Ahad Ahd Ah_Isnin Isn Is_Selasa Sel Sl_Rabu Rab Rb_Khamis Kha Km_Jumaat Jum Jm_Sabtu Sab Sb'.split('_'); @@ -112,7 +112,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'beberapa saat', '44 saat = beberapa saat'); @@ -145,21 +145,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 tahun', '5 tahun = 5 tahun'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'dalam beberapa saat', 'prefix'); assert.equal(moment(0).from(30000), 'beberapa saat yang lepas', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'beberapa saat yang lepas', 'waktu sekarang dari sekarang sepatutnya menunjukkan sebagai telah lepas'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa saat', 'dalam beberapa saat'); assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'dalam 5 hari'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Hari ini pukul 02.00', 'hari ini pada waktu yang sama'); @@ -170,7 +170,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kelmarin pukul 02.00', 'kelmarin pada waktu yang sama'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -182,7 +182,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -194,7 +194,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -208,7 +208,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); @@ -216,7 +216,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); @@ -225,7 +225,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); @@ -234,7 +234,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); @@ -243,7 +243,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); @@ -252,7 +252,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); @@ -261,7 +261,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); @@ -269,7 +269,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 sepatutnya minggu 2'); @@ -277,7 +277,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -291,7 +291,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -303,7 +303,7 @@ test("meridiem invariant", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -316,7 +316,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/my.js b/src/test/locale/my.js index b0fe0349e..b3ae7f53a 100644 --- a/src/test/locale/my.js +++ b/src/test/locale/my.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("my"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('my'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'), i; @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'တနင်္ဂနွေ, ဖေဖော်ဝါရီ ၁၄ ၂၀၁၀, ၃:၂၅:၅၀ pm'], ['ddd, hA', 'နွေ, ၃PM'], @@ -55,7 +55,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '၁', '၁'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '၂', '၂'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '၃', '၃'); @@ -92,7 +92,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '၃၁', '၃၁'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -100,7 +100,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'တနင်္ဂနွေ နွေ နွေ_တနင်္လာ လာ လာ_အင်္ဂါ င်္ဂါ င်္ဂါ_ဗုဒ္ဓဟူး ဟူး ဟူး_ကြာသပတေး ကြာ ကြာ_သောကြာ သော သော_စနေ နေ နေ'.split('_'), i; @@ -109,7 +109,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({ s: 44 @@ -197,16 +197,16 @@ test("from", function (assert) { }), true), '၅ နှစ်', '၅ နှစ် = ၅ နှစ်'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'prefix'); assert.equal(moment(0).from(30000), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'ယခုမှစပြီး အတိတ်တွင်ဖော်ပြသလိုဖော်ပြမည်'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({ s: 30 }).fromNow(), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'လာမည့် စက္ကန်.အနည်းငယ် မှာ'); @@ -215,7 +215,7 @@ test("fromNow", function (assert) { }).fromNow(), 'လာမည့် ၅ ရက် မှာ', 'လာမည့် ၅ ရက် မှာ'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'ယနေ. ၀၂:၀၀ မှာ', 'ယနေ. ဒီအချိန်'); @@ -236,7 +236,7 @@ test("calendar day", function (assert) { }).calendar(), 'မနေ.က ၀၂:၀၀ မှာ', 'မနေ.က ဒီအချိန်'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({ @@ -250,7 +250,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -265,7 +265,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({ w: 1 }), @@ -287,7 +287,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၂ ပတ် အတွင်း'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -295,7 +295,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -303,7 +303,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -312,7 +312,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -321,7 +321,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -330,7 +330,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -339,7 +339,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -348,7 +348,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '၅၂ ၅၂ ၅၂', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 8 2012 should be week 1'); @@ -356,7 +356,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -370,7 +370,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -383,7 +383,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/nb.js b/src/test/locale/nb.js index 1052bc5fa..715ff3200 100644 --- a/src/test/locale/nb.js +++ b/src/test/locale/nb.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("nb"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('nb'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'], ['ddd, hA', 'søn, 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'søndag søn sø_mandag man ma_tirsdag tirs ti_onsdag ons on_torsdag tors to_fredag fre fr_lørdag lør lø'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'noen sekunder', '44 sekunder = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ett minutt', '45 seconds = a minute'); @@ -137,21 +137,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'om noen sekunder', 'prefix'); assert.equal(moment(0).from(30000), 'for noen sekunder siden', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'for noen sekunder siden', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'om noen sekunder', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dager', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'i dag kl. 2.00', 'today at the same time'); @@ -162,7 +162,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'i går kl. 2.00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -174,7 +174,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -283,7 +283,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ne.js b/src/test/locale/ne.js index c52ea1ca0..8ca59cd2e 100644 --- a/src/test/locale/ne.js +++ b/src/test/locale/ne.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ne"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ne'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, aको h:mm:ss बजे', 'आइतबार, १४ फेब्रुवरी २०१०, बेलुकाको ३:२५:५० बजे'], ['ddd, aको h बजे', 'आइत., बेलुकाको ३ बजे'], @@ -52,7 +52,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३'); @@ -89,21 +89,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'आइतबार आइत. आइ._सोमबार सोम. सो._मङ्गलबार मङ्गल. मङ्_बुधबार बुध. बु._बिहिबार बिहि. बि._शुक्रबार शुक्र. शु._शनिबार शनि. श.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'केही समय', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'एक मिनेट', '45 seconds = a minute'); @@ -135,21 +135,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ बर्ष', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'केही समयमा', 'prefix'); assert.equal(moment(0).from(30000), 'केही समय अगाडी', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'केही समय अगाडी', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'केही समयमा', 'केही समयमा'); assert.equal(moment().add({d: 5}).fromNow(), '५ दिनमा', '५ दिनमा'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'आज रातीको २:०० बजे', 'today at the same time'); @@ -160,7 +160,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'हिजो रातीको २:०० बजे', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -172,7 +172,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -184,7 +184,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -198,7 +198,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'राती', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'बिहान', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दिउँसो', 'during day'); @@ -214,7 +214,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'राती', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -222,7 +222,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -230,7 +230,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -239,7 +239,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -248,7 +248,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -257,7 +257,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -266,7 +266,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -275,7 +275,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '१ ०१ १', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '२ ०२ २', 'Jan 2 2012 should be week 2'); @@ -283,7 +283,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '३ ०३ ३', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -297,7 +297,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -310,7 +310,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -322,7 +322,7 @@ test("meridiem invariant", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/nl.js b/src/test/locale/nl.js index 1e6097550..fd37ab23d 100644 --- a/src/test/locale/nl.js +++ b/src/test/locale/nl.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("nl"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('nl'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januari jan._februari feb._maart mrt._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'], ['ddd, HH', 'zo., 15'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januari jan._februari feb._maart mrt._april apr._mei mei_juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'zondag zo. Zo_maandag ma. Ma_dinsdag di. Di_woensdag wo. Wo_donderdag do. Do_vrijdag vr. Vr_zaterdag za. Za'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'een paar seconden', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'één minuut', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 jaar', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'over een paar seconden', 'prefix'); assert.equal(moment(0).from(30000), 'een paar seconden geleden', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'een paar seconden geleden', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'over een paar seconden', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'over 5 dagen', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'vandaag om 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'gisteren om 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,12 +199,12 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("month abbreviation", function (assert) { +test('month abbreviation', function (assert) { assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot'); assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -212,7 +212,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -220,7 +220,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -229,7 +229,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -238,7 +238,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -247,7 +247,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -256,7 +256,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -265,7 +265,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1ste', 'Jan 8 2012 should be week 1'); @@ -273,7 +273,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -287,7 +287,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -300,7 +300,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/nn.js b/src/test/locale/nn.js index b25eaf898..ff4991e74 100644 --- a/src/test/locale/nn.js +++ b/src/test/locale/nn.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("nn"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('nn'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'sundag, februar 14. 2010, 3:25:50 pm'], ['ddd, hA', 'sun, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'sundag sun su_måndag mån må_tysdag tys ty_onsdag ons on_torsdag tor to_fredag fre fr_laurdag lau lø'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nokre sekund', '44 sekunder = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eit minutt', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'om nokre sekund', 'prefix'); assert.equal(moment(0).from(30000), 'for nokre sekund sidan', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'for nokre sekund sidan', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'om nokre sekund', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dagar', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'I dag klokka 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'I går klokka 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -207,7 +207,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -251,7 +251,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -260,7 +260,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -282,7 +282,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -295,7 +295,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/pl.js b/src/test/locale/pl.js index f0e884bec..42c064f72 100644 --- a/src/test/locale/pl.js +++ b/src/test/locale/pl.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("pl"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('pl'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'], ['ddd, hA', 'nie, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'niedziela nie N_poniedziałek pon Pn_wtorek wt Wt_środa śr Śr_czwartek czw Cz_piątek pt Pt_sobota sb So'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'kilka sekund', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuta', '45 seconds = a minute'); @@ -140,22 +140,22 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 223}), true), '223 lata', '223 years = 223 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'za kilka sekund', 'prefix'); assert.equal(moment(0).from(30000), 'kilka sekund temu', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'kilka sekund temu', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'za kilka sekund', 'in a few seconds'); assert.equal(moment().add({h: 1}).fromNow(), 'za godzinę', 'in an hour'); assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dni', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Dziś o 02:00', 'today at the same time'); @@ -166,7 +166,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Wczoraj o 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -178,7 +178,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -206,7 +206,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -220,7 +220,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -228,7 +228,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -236,7 +236,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -245,7 +245,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -254,7 +254,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -263,7 +263,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -272,7 +272,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -281,7 +281,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -289,7 +289,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -303,7 +303,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -316,7 +316,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/pt-br.js b/src/test/locale/pt-br.js index d36960ba7..f1a2c3b73 100644 --- a/src/test/locale/pt-br.js +++ b/src/test/locale/pt-br.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("pt-br"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('pt-br'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i; function equalTest(input, mmm, i) { @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'domingo, fevereiro 14º 2010, 3:25:50 pm'], ['ddd, hA', 'dom, 3PM'], @@ -55,7 +55,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); @@ -92,21 +92,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'domingo dom_segunda-feira seg_terça-feira ter_quarta-feira qua_quinta-feira qui_sexta-feira sex_sábado sáb'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundos', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'um minuto', '45 seconds = a minute'); @@ -138,17 +138,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'em segundos', 'prefix'); assert.equal(moment(0).from(30000), 'segundos atrás', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'em segundos', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Hoje às 02:00', 'today at the same time'); @@ -159,7 +159,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ontem às 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -171,7 +171,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -183,7 +183,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -197,7 +197,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -205,7 +205,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -214,7 +214,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -258,7 +258,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1º', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2'); @@ -266,7 +266,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -280,7 +280,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/pt.js b/src/test/locale/pt.js index 0a2b046a8..406d7a996 100644 --- a/src/test/locale/pt.js +++ b/src/test/locale/pt.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("pt"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('pt'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'domingo, fevereiro 14º 2010, 3:25:50 pm'], ['ddd, hA', 'dom, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'domingo dom dom_segunda-feira seg 2ª_terça-feira ter 3ª_quarta-feira qua 4ª_quinta-feira qui 5ª_sexta-feira sex 6ª_sábado sáb sáb'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'segundos', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'um minuto', '45 seconds = a minute'); @@ -136,17 +136,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 anos', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'em segundos', 'prefix'); assert.equal(moment(0).from(30000), 'há segundos', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'em segundos', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Hoje às 02:00', 'today at the same time'); @@ -157,7 +157,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Ontem às 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -169,7 +169,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -181,7 +181,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -195,7 +195,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -203,7 +203,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -211,7 +211,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -220,7 +220,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -229,7 +229,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -238,7 +238,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -247,7 +247,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -256,7 +256,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1º', 'Jan 8 2012 should be week 1'); @@ -264,7 +264,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -278,7 +278,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -291,7 +291,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ro.js b/src/test/locale/ro.js index d8df062e6..d9a450263 100644 --- a/src/test/locale/ro.js +++ b/src/test/locale/ro.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ro"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ro'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss A', 'duminică, februarie 14 2010, 3:25:50 PM'], ['ddd, hA', 'Dum, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'duminică Dum Du_luni Lun Lu_marți Mar Ma_miercuri Mie Mi_joi Joi Jo_vineri Vin Vi_sâmbătă Sâm Sâ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'câteva secunde', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minut', '45 seconds = a minute'); @@ -144,21 +144,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 220}), true), '220 de ani', '220 years = 220 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'peste câteva secunde', 'prefix'); assert.equal(moment(0).from(30000), 'câteva secunde în urmă', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'câteva secunde în urmă', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'peste câteva secunde', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'peste 5 zile', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'azi la 2:00', 'today at the same time'); @@ -169,7 +169,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'ieri la 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -181,7 +181,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -193,7 +193,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -207,7 +207,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -250,7 +250,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 2'); @@ -276,7 +276,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -290,7 +290,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -303,7 +303,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ru.js b/src/test/locale/ru.js index 4c2827046..db6cc72ff 100644 --- a/src/test/locale/ru.js +++ b/src/test/locale/ru.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ru"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ru'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,11 +20,11 @@ test("parse", function (assert) { } }); -test("parse exceptional case", function (assert) { +test('parse exceptional case', function (assert) { assert.equal(moment('11 мая 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989'); }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, HH:mm:ss', 'воскресенье, 14-го февраля 2010, 15:25:50'], ['ddd, h A', 'вс, 3 дня'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format meridiem", function (assert) { +test('format meridiem', function (assert) { assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночи', 'night'); assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночи', 'night'); assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'утра', 'morning'); @@ -68,7 +68,7 @@ test("format meridiem", function (assert) { assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечера', 'evening'); }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-й', '1-й'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-й', '2-й'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-й', '3-й'); @@ -105,14 +105,14 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-й', '31-й'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format month case", function (assert) { +test('format month case', function (assert) { var months = { 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') @@ -123,7 +123,7 @@ test("format month case", function (assert) { } }); -test("format month short case", function (assert) { +test('format month short case', function (assert) { var monthsShort = { 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') @@ -134,7 +134,7 @@ test("format month short case", function (assert) { } }); -test("format month case with escaped symbols", function (assert) { +test('format month case with escaped symbols', function (assert) { var months = { 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') @@ -147,7 +147,7 @@ test("format month case with escaped symbols", function (assert) { } }); -test("format month short case with escaped symbols", function (assert) { +test('format month short case with escaped symbols', function (assert) { var monthsShort = { 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') @@ -160,14 +160,14 @@ test("format month short case with escaped symbols", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'воскресенье вс вс_понедельник пн пн_вторник вт вт_среда ср ср_четверг чт чт_пятница пт пт_суббота сб сб'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'несколько секунд', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'минута', '45 seconds = a minute'); @@ -202,19 +202,19 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 лет', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'через несколько секунд', 'prefix'); assert.equal(moment(0).from(30000), 'несколько секунд назад', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'через несколько секунд', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'через 5 дней', 'in 5 days'); assert.equal(moment().add({m: 31}).fromNow(), 'через 31 минуту', 'in 31 minutes = in 31 minutes'); assert.equal(moment().subtract({m: 31}).fromNow(), '31 минуту назад', '31 minutes ago = 31 minutes ago'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Сегодня в 02:00', 'today at the same time'); @@ -225,7 +225,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Вчера в 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { return d.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; @@ -241,7 +241,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, now; function makeFormatLast(d) { @@ -294,7 +294,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -308,7 +308,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -316,7 +316,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -324,7 +324,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -333,7 +333,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -342,7 +342,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -351,7 +351,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -360,7 +360,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -369,7 +369,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-я', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-я', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-я', 'Jan 2 2012 should be week 2'); @@ -377,7 +377,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-я', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -391,7 +391,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -404,7 +404,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/sk.js b/src/test/locale/sk.js index 501309163..61c8cbf39 100644 --- a/src/test/locale/sk.js +++ b/src/test/locale/sk.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("sk"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('sk'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'január jan._február feb._marec mar._apríl apr._máj máj_jún jún._júl júl._august aug._september sep._október okt._november nov._december dec.'.split('_'), i; function equalTest(input, mmm, monthIndex) { assert.equal(moment(input, mmm).month(), monthIndex, input + ' should be month ' + (monthIndex + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss', 'nedeľa, február 14. 2010, 3:25:50'], ['ddd, h', 'ne, 3'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'január jan_február feb_marec mar_apríl apr_máj máj_jún jún_júl júl_august aug_september sep_október okt_november nov_december dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'nedeľa ne ne_pondelok po po_utorok ut ut_streda st st_štvrtok št št_piatok pi pi_sobota so so'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'pár sekúnd', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minúta', '45 seconds = a minute'); @@ -136,16 +136,16 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 rokov', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'za pár sekúnd', 'prefix'); assert.equal(moment(0).from(30000), 'pred pár sekundami', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'pred pár sekundami', 'now from now should display as in the past'); }); -test("fromNow (future)", function (assert) { +test('fromNow (future)', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'za pár sekúnd', 'in a few seconds'); assert.equal(moment().add({m: 1}).fromNow(), 'za minútu', 'in a minute'); assert.equal(moment().add({m: 3}).fromNow(), 'za 3 minúty', 'in 3 minutes'); @@ -164,7 +164,7 @@ test("fromNow (future)", function (assert) { assert.equal(moment().add({y: 10}).fromNow(), 'za 10 rokov', 'in 10 years'); }); -test("fromNow (past)", function (assert) { +test('fromNow (past)', function (assert) { assert.equal(moment().subtract({s: 30}).fromNow(), 'pred pár sekundami', 'a few seconds ago'); assert.equal(moment().subtract({m: 1}).fromNow(), 'pred minútou', 'a minute ago'); assert.equal(moment().subtract({m: 3}).fromNow(), 'pred 3 minútami', '3 minutes ago'); @@ -183,7 +183,7 @@ test("fromNow (past)", function (assert) { assert.equal(moment().subtract({y: 10}).fromNow(), 'pred 10 rokmi', '10 years ago'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'dnes o 2:00', 'today at the same time'); @@ -194,7 +194,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'včera o 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m, nextDay; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -230,7 +230,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, lastDay; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -266,7 +266,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -280,14 +280,14 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("humanize duration", function (assert) { +test('humanize duration', function (assert) { assert.equal(moment.duration(1, 'minutes').humanize(), 'minúta', 'a minute (future)'); assert.equal(moment.duration(1, 'minutes').humanize(true), 'za minútu', 'in a minute'); assert.equal(moment.duration(-1, 'minutes').humanize(), 'minúta', 'a minute (past)'); assert.equal(moment.duration(-1, 'minutes').humanize(true), 'pred minútou', 'a minute ago'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -295,7 +295,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -303,7 +303,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -312,7 +312,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -321,7 +321,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -330,7 +330,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -339,7 +339,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -348,7 +348,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -356,7 +356,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -370,7 +370,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -383,7 +383,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/sl.js b/src/test/locale/sl.js index 5f7d3c3e9..ac0fdfc4a 100644 --- a/src/test/locale/sl.js +++ b/src/test/locale/sl.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("sl"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('sl'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan._februar feb._marec mar._april apr._maj maj_junij jun._julij jul._avgust avg._september sep._oktober okt._november nov._december dec.'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedelja, 14. februar 2010, 3:25:50 pm'], ['ddd, hA', 'ned., 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan._februar feb._marec mar._april apr._maj maj._junij jun._julij jul._avgust avg._september sep._oktober okt._november nov._december dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'nedelja ned. ne_ponedeljek pon. po_torek tor. to_sreda sre. sr_četrtek čet. če_petek pet. pe_sobota sob. so'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nekaj sekund', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ena minuta', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 let', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'čez nekaj sekund', 'prefix'); assert.equal(moment(0).from(30000), 'nekaj sekund nazaj', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'nekaj sekund nazaj', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'čez nekaj sekund', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'čez 5 dni', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'danes ob 2:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'včeraj ob 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { @@ -190,7 +190,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -217,7 +217,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -231,7 +231,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -239,7 +239,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -247,7 +247,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -256,7 +256,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -265,7 +265,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -274,7 +274,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -283,7 +283,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -292,7 +292,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -300,7 +300,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -314,7 +314,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -327,7 +327,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/sq.js b/src/test/locale/sq.js index 4b5fa808d..8adb7a62b 100644 --- a/src/test/locale/sq.js +++ b/src/test/locale/sq.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("sq"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('sq'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'Janar Jan_Shkurt Shk_Mars Mar_Prill Pri_Maj Maj_Qershor Qer_Korrik Kor_Gusht Gus_Shtator Sht_Tetor Tet_Nëntor Nën_Dhjetor Dhj'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, HH:mm:ss', 'E Diel, Shkurt 14. 2010, 15:25:50'], ['ddd, HH', 'Die, 15'], @@ -57,12 +57,12 @@ test("format", function (assert) { } }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 0]).format('A'), 'PD', 'before dawn'); assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), 'MD', 'noon'); }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -99,7 +99,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'Janar Jan_Shkurt Shk_Mars Mar_Prill Pri_Maj Maj_Qershor Qer_Korrik Kor_Gusht Gus_Shtator Sht_Tetor Tet_Nëntor Nën_Dhjetor Dhj'.split('_'); @@ -108,7 +108,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'E Diel Die D_E Hënë Hën H_E Martë Mar Ma_E Mërkurë Mër Më_E Enjte Enj E_E Premte Pre P_E Shtunë Sht Sh'.split('_'); @@ -117,7 +117,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'disa sekonda', '44 seconds = a few seconds'); @@ -150,21 +150,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 vite', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'në disa sekonda', 'prefix'); assert.equal(moment(0).from(30000), 'disa sekonda më parë', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'disa sekonda më parë', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'në disa sekonda', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'në 5 ditë', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Sot në 02:00', 'today at the same time'); @@ -175,7 +175,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Dje në 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -188,7 +188,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -201,7 +201,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -215,7 +215,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -231,7 +231,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -240,7 +240,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -249,7 +249,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -258,7 +258,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -267,7 +267,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -276,7 +276,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); @@ -284,7 +284,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -311,7 +311,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/sr-cyrl.js b/src/test/locale/sr-cyrl.js index 8684242e7..a54972471 100644 --- a/src/test/locale/sr-cyrl.js +++ b/src/test/locale/sr-cyrl.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("sr-cyrl"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('sr-cyrl'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'јануар јан._фебруар феб._март мар._април апр._мај мај_јун јун_јул јул_август авг._септембар сеп._октобар окт._новембар нов._децембар дец.'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'недеља, 14. фебруар 2010, 3:25:50 pm'], ['ddd, hA', 'нед., 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -91,7 +91,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'јануар јан._фебруар феб._март мар._април апр._мај мај_јун јун_јул јул_август авг._септембар сеп._октобар окт._новембар нов._децембар дец.'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -99,7 +99,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'недеља нед. не_понедељак пон. по_уторак уто. ут_среда сре. ср_четвртак чет. че_петак пет. пе_субота суб. су'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -107,7 +107,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'неколико секунди', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'један минут', '45 seconds = a minute'); @@ -139,21 +139,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 година', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'за неколико секунди', 'prefix'); assert.equal(moment(0).from(30000), 'пре неколико секунди', 'prefix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'пре неколико секунди', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'за неколико секунди', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'за 5 дана', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'данас у 2:00', 'today at the same time'); @@ -164,7 +164,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'јуче у 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { @@ -193,7 +193,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -220,7 +220,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -234,7 +234,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -242,7 +242,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -250,7 +250,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -277,7 +277,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -286,7 +286,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -295,7 +295,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -303,7 +303,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -317,7 +317,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -330,7 +330,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/sr.js b/src/test/locale/sr.js index 1987a4bbe..a6f492fc4 100644 --- a/src/test/locale/sr.js +++ b/src/test/locale/sr.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("sr"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('sr'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'nedelja, 14. februar 2010, 3:25:50 pm'], ['ddd, hA', 'ned., 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.'); @@ -91,7 +91,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -99,7 +99,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'nedelja ned. ne_ponedeljak pon. po_utorak uto. ut_sreda sre. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -107,7 +107,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'nekoliko sekundi', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'jedan minut', '45 seconds = a minute'); @@ -139,21 +139,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 godina', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'za nekoliko sekundi', 'prefix'); assert.equal(moment(0).from(30000), 'pre nekoliko sekundi', 'prefix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'pre nekoliko sekundi', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'za nekoliko sekundi', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'danas u 2:00', 'today at the same time'); @@ -164,7 +164,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'juče u 2:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; function makeFormat(d) { @@ -193,7 +193,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -220,7 +220,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -234,7 +234,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -242,7 +242,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -250,7 +250,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -259,7 +259,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -277,7 +277,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -286,7 +286,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -295,7 +295,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2.', 'Jan 2 2012 should be week 2'); @@ -303,7 +303,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -317,7 +317,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -330,7 +330,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/sv.js b/src/test/locale/sv.js index f87b550f2..4dcb0d109 100644 --- a/src/test/locale/sv.js +++ b/src/test/locale/sv.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("sv"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('sv'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'söndag, februari 14e 2010, 3:25:50 pm'], ['ddd, hA', 'sön, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'söndag sön sö_måndag mån må_tisdag tis ti_onsdag ons on_torsdag tor to_fredag fre fr_lördag lör lö'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'några sekunder', '44 sekunder = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'en minut', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 år', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'om några sekunder', 'prefix'); assert.equal(moment(0).from(30000), 'för några sekunder sedan', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'för några sekunder sedan', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'om några sekunder', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dagar', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Idag 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Igår 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -207,7 +207,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -251,7 +251,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -260,7 +260,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52a', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1a', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1a', 'Jan 8 2012 should be week 1'); @@ -268,7 +268,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2a', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -282,7 +282,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -295,7 +295,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/ta.js b/src/test/locale/ta.js index c2b075ee5..d07b4665d 100644 --- a/src/test/locale/ta.js +++ b/src/test/locale/ta.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("ta"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('ta'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ஜனவரி ஜனவரி_பிப்ரவரி பிப்ரவரி_மார்ச் மார்ச்_ஏப்ரல் ஏப்ரல்_மே மே_ஜூன் ஜூன்_ஜூலை ஜூலை_ஆகஸ்ட் ஆகஸ்ட்_செப்டெம்பர் செப்டெம்பர்_அக்டோபர் அக்டோபர்_நவம்பர் நவம்பர்_டிசம்பர் டிசம்பர்'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'ஞாயிற்றுக்கிழமை, பிப்ரவரி 14வது 2010, 3:25:50 எற்பாடு'], ['ddd, hA', 'ஞாயிறு, 3 எற்பாடு'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1வது', '1வது'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2வது', '2வது'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3வது', '3வது'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31வது', '31வது'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ஜனவரி ஜனவரி_பிப்ரவரி பிப்ரவரி_மார்ச் மார்ச்_ஏப்ரல் ஏப்ரல்_மே மே_ஜூன் ஜூன்_ஜூலை ஜூலை_ஆகஸ்ட் ஆகஸ்ட்_செப்டெம்பர் செப்டெம்பர்_அக்டோபர் அக்டோபர்_நவம்பர் நவம்பர்_டிசம்பர் டிசம்பர்'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'ஞாயிற்றுக்கிழமை ஞாயிறு ஞா_திங்கட்கிழமை திங்கள் தி_செவ்வாய்கிழமை செவ்வாய் செ_புதன்கிழமை புதன் பு_வியாழக்கிழமை வியாழன் வி_வெள்ளிக்கிழமை வெள்ளி வெ_சனிக்கிழமை சனி ச'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ஒரு சில விநாடிகள்', '44 விநாடிகள் = ஒரு சில விநாடிகள்'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ஒரு நிமிடம்', '45 விநாடிகள் = ஒரு நிமிடம்'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ஆண்டுகள்', '5 ஆண்டுகள் = 5 ஆண்டுகள்'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'ஒரு சில விநாடிகள் இல்', 'prefix'); assert.equal(moment(0).from(30000), 'ஒரு சில விநாடிகள் முன்', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'ஒரு சில விநாடிகள் முன்', 'இப்போது இருந்து கடந்த காலத்தில் காட்ட வேண்டும்'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'ஒரு சில விநாடிகள் இல்', 'ஒரு சில விநாடிகள் இல்'); assert.equal(moment().add({d: 5}).fromNow(), '5 நாட்கள் இல்', '5 நாட்கள் இல்'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'இன்று 02:00', 'இன்று 02:00'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'நேற்று 02:00', 'நேற்று 02:00'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -217,7 +217,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -226,7 +226,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -244,7 +244,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -253,7 +253,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 30]).format('a'), ' யாமம்', '(after) midnight'); assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), ' வைகறை', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), ' காலை', 'morning'); @@ -271,7 +271,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 23, 30]).format('a'), ' யாமம்', '(before) midnight'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -285,7 +285,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -298,7 +298,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -310,7 +310,7 @@ test("meridiem invariant", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/th.js b/src/test/locale/th.js index 4d091aec2..e37f6da02 100644 --- a/src/test/locale/th.js +++ b/src/test/locale/th.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("th"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('th'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'มกราคม มกรา_กุมภาพันธ์ กุมภา_มีนาคม มีนา_เมษายน เมษา_พฤษภาคม พฤษภา_มิถุนายน มิถุนา_กรกฎาคม กรกฎา_สิงหาคม สิงหา_กันยายน กันยา_ตุลาคม ตุลา_พฤศจิกายน พฤศจิกา_ธันวาคม ธันวา'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, h:mm:ss a', 'อาทิตย์, 14 กุมภาพันธ์ 2010, 3:25:50 หลังเที่ยง'], ['ddd, h A', 'อาทิตย์, 3 หลังเที่ยง'], @@ -53,21 +53,21 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'มกราคม มกรา_กุมภาพันธ์ กุมภา_มีนาคม มีนา_เมษายน เมษา_พฤษภาคม พฤษภา_มิถุนายน มิถุนา_กรกฎาคม กรกฎา_สิงหาคม สิงหา_กันยายน กันยา_ตุลาคม ตุลา_พฤศจิกายน พฤศจิกา_ธันวาคม ธันวา'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'อาทิตย์ อาทิตย์ อา._จันทร์ จันทร์ จ._อังคาร อังคาร อ._พุธ พุธ พ._พฤหัสบดี พฤหัส พฤ._ศุกร์ ศุกร์ ศ._เสาร์ เสาร์ ส.'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ไม่กี่วินาที', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1 นาที', '45 seconds = a minute'); @@ -99,21 +99,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ปี', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'อีก ไม่กี่วินาที', 'prefix'); assert.equal(moment(0).from(30000), 'ไม่กี่วินาทีที่แล้ว', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'ไม่กี่วินาทีที่แล้ว', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'อีก ไม่กี่วินาที', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'อีก 5 วัน', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'วันนี้ เวลา 2 นาฬิกา 0 นาที', 'today at the same time'); @@ -124,7 +124,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'เมื่อวานนี้ เวลา 2 นาฬิกา 0 นาที', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -136,7 +136,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -148,7 +148,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -162,7 +162,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -170,7 +170,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -179,7 +179,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -188,7 +188,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -197,7 +197,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -206,7 +206,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -215,7 +215,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -223,7 +223,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2'); @@ -231,7 +231,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -245,7 +245,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -258,7 +258,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/tl-ph.js b/src/test/locale/tl-ph.js index 4f7fa0635..86c375104 100644 --- a/src/test/locale/tl-ph.js +++ b/src/test/locale/tl-ph.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("tl-ph"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('tl-ph'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Enero Ene_Pebrero Peb_Marso Mar_Abril Abr_Mayo May_Hunyo Hun_Hulyo Hul_Agosto Ago_Setyembre Set_Oktubre Okt_Nobyembre Nob_Disyembre Dis'.split('_'), i; function equalTest(input, mmm, i) { @@ -21,7 +21,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Linggo, Pebrero 14 2010, 3:25:50 pm'], ['ddd, hA', 'Lin, 3PM'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -91,21 +91,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Enero Ene_Pebrero Peb_Marso Mar_Abril Abr_Mayo May_Hunyo Hun_Hulyo Hul_Agosto Ago_Setyembre Set_Oktubre Okt_Nobyembre Nob_Disyembre Dis'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Linggo Lin Li_Lunes Lun Lu_Martes Mar Ma_Miyerkules Miy Mi_Huwebes Huw Hu_Biyernes Biy Bi_Sabado Sab Sab'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ilang segundo', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'isang minuto', '45 seconds = a minute'); @@ -137,17 +137,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 taon', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'sa loob ng ilang segundo', 'prefix'); assert.equal(moment(0).from(30000), 'ilang segundo ang nakalipas', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'sa loob ng ilang segundo', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'sa loob ng 5 araw', 'in 5 days'); }); -test("same day", function (assert) { +test('same day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Ngayon sa 02:00', 'today at the same time'); @@ -158,7 +158,7 @@ test("same day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Kahapon sa 02:00', 'yesterday at the same time'); }); -test("same next week", function (assert) { +test('same next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -171,7 +171,7 @@ test("same next week", function (assert) { } }); -test("same last week", function (assert) { +test('same last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -184,7 +184,7 @@ test("same last week", function (assert) { } }); -test("same all else", function (assert) { +test('same all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -198,7 +198,7 @@ test("same all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -206,7 +206,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -214,7 +214,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -241,7 +241,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -259,7 +259,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1'); @@ -267,7 +267,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -281,7 +281,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -294,7 +294,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/tr.js b/src/test/locale/tr.js index 8c1482637..e4ccbf70d 100644 --- a/src/test/locale/tr.js +++ b/src/test/locale/tr.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("tr"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('tr'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Pazar, Şubat 14\'üncü 2010, 3:25:50 pm'], ['ddd, hA', 'Paz, 3PM'], @@ -64,7 +64,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1\'inci', '1st'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2\'nci', '2nd'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3\'üncü', '3rd'); @@ -101,21 +101,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31\'inci', '31st'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Pazar Paz Pz_Pazartesi Pts Pt_Salı Sal Sa_Çarşamba Çar Ça_Perşembe Per Pe_Cuma Cum Cu_Cumartesi Cts Ct'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'birkaç saniye', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'bir dakika', '45 seconds = a minute'); @@ -147,21 +147,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 yıl', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'birkaç saniye sonra', 'prefix'); assert.equal(moment(0).from(30000), 'birkaç saniye önce', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'birkaç saniye önce', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'birkaç saniye sonra', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 gün sonra', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'bugün saat 02:00', 'today at the same time'); @@ -172,7 +172,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'dün 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -184,7 +184,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -196,7 +196,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -210,7 +210,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -218,7 +218,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -226,7 +226,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -244,7 +244,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -253,7 +253,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -262,7 +262,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -271,7 +271,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1\'inci', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1\'inci', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2\'nci', 'Jan 2 2012 should be week 2'); @@ -279,7 +279,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3\'üncü', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -306,7 +306,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/tzm-latn.js b/src/test/locale/tzm-latn.js index 6fe1c7cc5..1b06818d0 100644 --- a/src/test/locale/tzm-latn.js +++ b/src/test/locale/tzm-latn.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("tzm-latn"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('tzm-latn'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'innayr innayr_brˤayrˤ brˤayrˤ_marˤsˤ marˤsˤ_ibrir ibrir_mayyw mayyw_ywnyw ywnyw_ywlywz ywlywz_ɣwšt ɣwšt_šwtanbir šwtanbir_ktˤwbrˤ ktˤwbrˤ_nwwanbir nwwanbir_dwjnbir dwjnbir'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'asamas, brˤayrˤ 14 2010, 3:25:50 pm'], ['ddd, hA', 'asamas, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'innayr innayr_brˤayrˤ brˤayrˤ_marˤsˤ marˤsˤ_ibrir ibrir_mayyw mayyw_ywnyw ywnyw_ywlywz ywlywz_ɣwšt ɣwšt_šwtanbir šwtanbir_ktˤwbrˤ ktˤwbrˤ_nwwanbir nwwanbir_dwjnbir dwjnbir'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'asamas asamas asamas_aynas aynas aynas_asinas asinas asinas_akras akras akras_akwas akwas akwas_asimwas asimwas asimwas_asiḍyas asiḍyas asiḍyas'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'imik', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minuḍ', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 isgasn', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'dadkh s yan imik', 'prefix'); assert.equal(moment(0).from(30000), 'yan imik', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'yan imik', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'dadkh s yan imik', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'dadkh s yan 5 ossan', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'asdkh g 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'assant g 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); @@ -207,7 +207,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); @@ -258,7 +258,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '1 01 1', 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 should be week 2'); @@ -266,7 +266,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -280,7 +280,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/tzm.js b/src/test/locale/tzm.js index 6d10daf45..a3d0891d0 100644 --- a/src/test/locale/tzm.js +++ b/src/test/locale/tzm.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("tzm"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('tzm'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'ⵉⵏⵏⴰⵢⵔ ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'ⴰⵙⴰⵎⴰⵙ, ⴱⵕⴰⵢⵕ 14 2010, 3:25:50 pm'], ['ddd, hA', 'ⴰⵙⴰⵎⴰⵙ, 3PM'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'ⵉⵏⵏⴰⵢⵔ ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'ⴰⵙⴰⵎⴰⵙ ⴰⵙⴰⵎⴰⵙ ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ ⴰⵢⵏⴰⵙ ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ ⴰⵙⵉⵏⴰⵙ ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ ⴰⴽⵔⴰⵙ ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ ⴰⴽⵡⴰⵙ ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ⵉⵎⵉⴽ', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ⵎⵉⵏⵓⴺ', '45 seconds = a minute'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ⵉⵙⴳⴰⵙⵏ', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ', 'prefix'); assert.equal(moment(0).from(30000), 'ⵢⴰⵏ ⵉⵎⵉⴽ', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'ⵢⴰⵏ ⵉⵎⵉⴽ', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ 5 oⵙⵙⴰⵏ', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'ⴰⵙⴷⵅ ⴴ 02:00', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'ⴰⵚⴰⵏⵜ ⴴ 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -185,7 +185,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -199,7 +199,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); @@ -207,7 +207,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); @@ -215,7 +215,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); @@ -224,7 +224,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); @@ -233,7 +233,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); @@ -242,7 +242,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); @@ -250,7 +250,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); @@ -258,7 +258,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '1 01 1', 'Jan 6 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 should be week 2'); @@ -266,7 +266,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -280,7 +280,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/uk.js b/src/test/locale/uk.js index 7dd4fe84c..d5f1d31b6 100644 --- a/src/test/locale/uk.js +++ b/src/test/locale/uk.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("uk"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('uk'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'січень січ_лютий лют_березень бер_квітень квіт_травень трав_червень черв_липень лип_серпень серп_вересень вер_жовтень жовт_листопад лист_грудень груд'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do MMMM YYYY, HH:mm:ss', 'неділя, 14-го лютого 2010, 15:25:50'], ['ddd, h A', 'нд, 3 дня'], @@ -49,7 +49,7 @@ test("format", function (assert) { } }); -test("format meridiem", function (assert) { +test('format meridiem', function (assert) { assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночі', 'night'); assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночі', 'night'); assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'ранку', 'morning'); @@ -60,7 +60,7 @@ test("format meridiem", function (assert) { assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечора', 'evening'); }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-й', '1-й'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-й', '2-й'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-й', '3-й'); @@ -97,14 +97,14 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-й', '31-й'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'січень січ_лютий лют_березень бер_квітень квіт_травень трав_червень черв_липень лип_серпень серп_вересень вер_жовтень жовт_листопад лист_грудень груд'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format month case", function (assert) { +test('format month case', function (assert) { var months = { 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') @@ -115,14 +115,14 @@ test("format month case", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'неділя нд нд_понеділок пн пн_вівторок вт вт_середа ср ср_четвер чт чт_п’ятниця пт пт_субота сб сб'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'декілька секунд', '44 seconds = seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'хвилина', '45 seconds = a minute'); @@ -156,17 +156,17 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 років', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'за декілька секунд', 'prefix'); assert.equal(moment(0).from(30000), 'декілька секунд тому', 'suffix'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'за декілька секунд', 'in seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'за 5 днів', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Сьогодні о 02:00', 'today at the same time'); @@ -179,7 +179,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).add({h: 9}).calendar(), 'Сьогодні об 11:00', 'same day at 11 o\'clock'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -191,7 +191,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; function makeFormat(d) { @@ -218,7 +218,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -232,7 +232,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); @@ -240,7 +240,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -248,7 +248,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -257,7 +257,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -266,7 +266,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -275,7 +275,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); @@ -284,7 +284,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); @@ -293,7 +293,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-й', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-й', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-й', 'Jan 2 2012 should be week 2'); @@ -301,7 +301,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-й', 'Jan 9 2012 should be week 3'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -315,7 +315,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -328,7 +328,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/uz.js b/src/test/locale/uz.js index 0f6a71df1..2beb3e3bf 100644 --- a/src/test/locale/uz.js +++ b/src/test/locale/uz.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("uz"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('uz'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, Do-MMMM YYYY, h:mm:ss', 'Якшанба, 14-февраль 2010, 3:25:50'], ['ddd, h:mm', 'Якш, 3:25'], @@ -53,7 +53,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -90,21 +90,21 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = 'Якшанба Якш Як_Душанба Душ Ду_Сешанба Сеш Се_Чоршанба Чор Чо_Пайшанба Пай Па_Жума Жум Жу_Шанба Шан Ша'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'фурсат', '44 секунд = фурсат'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'бир дакика', '45 секунд = бир дакика'); @@ -136,21 +136,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 йил', '5 йил = 5 йил'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'Якин фурсат ичида', 'prefix'); assert.equal(moment(0).from(30000), 'Бир неча фурсат олдин', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'Бир неча фурсат олдин', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'Якин фурсат ичида', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), 'Якин 5 кун ичида', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Бугун соат 02:00 да', 'today at the same time'); @@ -161,7 +161,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Кеча соат 02:00 да', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -173,7 +173,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -186,7 +186,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -200,7 +200,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 1'); @@ -208,7 +208,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -216,7 +216,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -225,7 +225,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -234,7 +234,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -243,7 +243,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 53'); @@ -252,7 +252,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 52'); @@ -261,7 +261,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 1'); @@ -269,7 +269,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -283,7 +283,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -296,7 +296,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/vi.js b/src/test/locale/vi.js index a26406ce0..9850af046 100644 --- a/src/test/locale/vi.js +++ b/src/test/locale/vi.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("vi"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('vi'); -test("parse", function (assert) { +test('parse', function (assert) { var i, tests = 'tháng 1,Th01_tháng 2,Th02_tháng 3,Th03_tháng 4,Th04_tháng 5,Th05_tháng 6,Th06_tháng 7,Th07_tháng 8,Th08_tháng 9,Th09_tháng 10,Th10_tháng 11,Th11_tháng 12,Th12'.split('_'); @@ -23,7 +23,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'chủ nhật, tháng 2 14 2010, 3:25:50 pm'], ['ddd, hA', 'CN, 3PM'], @@ -57,7 +57,7 @@ test("format", function (assert) { } }); -test("format ordinal", function (assert) { +test('format ordinal', function (assert) { assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1'); assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2'); assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3'); @@ -94,7 +94,7 @@ test("format ordinal", function (assert) { assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31'); }); -test("format month", function (assert) { +test('format month', function (assert) { var i, expected = 'tháng 1,Th01_tháng 2,Th02_tháng 3,Th03_tháng 4,Th04_tháng 5,Th05_tháng 6,Th06_tháng 7,Th07_tháng 8,Th08_tháng 9,Th09_tháng 10,Th10_tháng 11,Th11_tháng 12,Th12'.split('_'); @@ -103,7 +103,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var i, expected = 'chủ nhật CN CN_thứ hai T2 T2_thứ ba T3 T3_thứ tư T4 T4_thứ năm T5 T5_thứ sáu T6 T6_thứ bảy T7 T7'.split('_'); @@ -112,7 +112,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'vài giây', '44 seconds = a few seconds'); @@ -145,21 +145,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 năm', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), 'vài giây tới', 'prefix'); assert.equal(moment(0).from(30000), 'vài giây trước', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), 'vài giây trước', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), 'vài giây tới', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5 ngày tới', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Hôm nay lúc 02:00', 'today at the same time'); @@ -170,7 +170,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), 'Hôm qua lúc 02:00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -183,7 +183,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { @@ -196,7 +196,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -210,7 +210,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); @@ -218,7 +218,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); @@ -226,7 +226,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); @@ -235,7 +235,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); @@ -244,7 +244,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -253,7 +253,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); @@ -262,7 +262,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); @@ -271,7 +271,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); }); -test("weeks year starting sunday formatted", function (assert) { +test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1'); @@ -279,7 +279,7 @@ test("weeks year starting sunday formatted", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -293,7 +293,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -306,7 +306,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/zh-cn.js b/src/test/locale/zh-cn.js index a5679d624..67323d79f 100644 --- a/src/test/locale/zh-cn.js +++ b/src/test/locale/zh-cn.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("zh-cn"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('zh-cn'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i; function equalTest(input, mmm, i) { @@ -22,7 +22,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, a h:mm:ss', '星期日, 二月 14日 2010, 下午 3:25:50'], ['ddd, Ah', '周日, 下午3'], @@ -56,7 +56,7 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -64,7 +64,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = '星期日 周日 日_星期一 周一 一_星期二 周二 二_星期三 周三 三_星期四 周四 四_星期五 周五 五_星期六 周六 六'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -72,7 +72,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '几秒', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1分钟', '45 seconds = a minute'); @@ -104,21 +104,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5年', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), '几秒内', 'prefix'); assert.equal(moment(0).from(30000), '几秒前', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), '几秒前', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), '几秒内', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5天内', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), '今天凌晨2点整', 'today at the same time'); @@ -129,7 +129,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), '昨天凌晨2点整', 'yesterday at the same time'); }); -test("calendar current week", function (assert) { +test('calendar current week', function (assert) { var i, m, today = moment().startOf('day'); @@ -142,7 +142,7 @@ test("calendar current week", function (assert) { } }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m, today = moment().startOf('day'); @@ -158,7 +158,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m, today = moment().startOf('day'); @@ -173,7 +173,7 @@ test("calendar last week", function (assert) { assert.equal(42, 42); }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -187,7 +187,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('LL'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 0]).format('A'), '凌晨', 'before dawn'); assert.equal(moment([2011, 2, 23, 6, 0]).format('A'), '早上', 'morning'); assert.equal(moment([2011, 2, 23, 9, 0]).format('A'), '上午', 'before noon'); @@ -196,14 +196,14 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 52'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 52, 'Dec 31 2006 should be week 52'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -212,7 +212,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -221,7 +221,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 should be week 52'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -230,7 +230,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); @@ -238,24 +238,24 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2010, 0, 2]).week(), 53, 'Jan 2 2010 should be week 53'); assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); assert.equal(moment([2011, 0, 8]).week(), 1, 'Jan 8 2011 should be week 1'); assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52周', 'Jan 1 2012 应该是第52周'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1周', 'Jan 7 2012 应该是第 1周'); assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2周', 'Jan 14 2012 应该是第 2周'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -269,7 +269,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -282,7 +282,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -294,7 +294,7 @@ test("meridiem invariant", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/locale/zh-tw.js b/src/test/locale/zh-tw.js index 9c5274b9a..a219ac876 100644 --- a/src/test/locale/zh-tw.js +++ b/src/test/locale/zh-tw.js @@ -1,8 +1,8 @@ -import {localeModule, test} from "../qunit"; -import {moment} from "../../moment"; -localeModule("zh-tw"); +import {localeModule, test} from '../qunit'; +import {moment} from '../../moment'; +localeModule('zh-tw'); -test("parse", function (assert) { +test('parse', function (assert) { var tests = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); @@ -20,7 +20,7 @@ test("parse", function (assert) { } }); -test("format", function (assert) { +test('format', function (assert) { var a = [ ['dddd, MMMM Do YYYY, a h:mm:ss', '星期日, 二月 14日 2010, 下午 3:25:50'], ['ddd, Ah', '週日, 下午3'], @@ -54,7 +54,7 @@ test("format", function (assert) { } }); -test("format month", function (assert) { +test('format month', function (assert) { var expected = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -62,7 +62,7 @@ test("format month", function (assert) { } }); -test("format week", function (assert) { +test('format week', function (assert) { var expected = '星期日 週日 日_星期一 週一 一_星期二 週二 二_星期三 週三 三_星期四 週四 四_星期五 週五 五_星期六 週六 六'.split('_'), i; for (i = 0; i < expected.length; i++) { @@ -70,7 +70,7 @@ test("format week", function (assert) { } }); -test("from", function (assert) { +test('from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '幾秒', '44 seconds = a few seconds'); assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '一分鐘', '45 seconds = a minute'); @@ -102,21 +102,21 @@ test("from", function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5年', '5 years = 5 years'); }); -test("suffix", function (assert) { +test('suffix', function (assert) { assert.equal(moment(30000).from(0), '幾秒內', 'prefix'); assert.equal(moment(0).from(30000), '幾秒前', 'suffix'); }); -test("now from now", function (assert) { +test('now from now', function (assert) { assert.equal(moment().fromNow(), '幾秒前', 'now from now should display as in the past'); }); -test("fromNow", function (assert) { +test('fromNow', function (assert) { assert.equal(moment().add({s: 30}).fromNow(), '幾秒內', 'in a few seconds'); assert.equal(moment().add({d: 5}).fromNow(), '5天內', 'in 5 days'); }); -test("calendar day", function (assert) { +test('calendar day', function (assert) { var a = moment().hours(2).minutes(0).seconds(0); assert.equal(moment(a).calendar(), '今天早上2點00', 'today at the same time'); @@ -127,7 +127,7 @@ test("calendar day", function (assert) { assert.equal(moment(a).subtract({d: 1}).calendar(), '昨天早上2點00', 'yesterday at the same time'); }); -test("calendar next week", function (assert) { +test('calendar next week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().add({d: i}); @@ -139,7 +139,7 @@ test("calendar next week", function (assert) { } }); -test("calendar last week", function (assert) { +test('calendar last week', function (assert) { var i, m; for (i = 2; i < 7; i++) { m = moment().subtract({d: i}); @@ -151,7 +151,7 @@ test("calendar last week", function (assert) { } }); -test("calendar all else", function (assert) { +test('calendar all else', function (assert) { var weeksAgo = moment().subtract({w: 1}), weeksFromNow = moment().add({w: 1}); @@ -165,7 +165,7 @@ test("calendar all else", function (assert) { assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); -test("meridiem", function (assert) { +test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 0]).format('a'), '早上', 'morning'); assert.equal(moment([2011, 2, 23, 9, 0]).format('a'), '上午', 'before noon'); assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), '中午', 'noon'); @@ -179,7 +179,7 @@ test("meridiem", function (assert) { assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night'); }); -test("weeks year starting sunday", function (assert) { +test('weeks year starting sunday', function (assert) { assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); @@ -187,7 +187,7 @@ test("weeks year starting sunday", function (assert) { assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); -test("weeks year starting monday", function (assert) { +test('weeks year starting monday', function (assert) { assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); @@ -196,7 +196,7 @@ test("weeks year starting monday", function (assert) { assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); -test("weeks year starting tuesday", function (assert) { +test('weeks year starting tuesday', function (assert) { assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); @@ -205,7 +205,7 @@ test("weeks year starting tuesday", function (assert) { assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); -test("weeks year starting wednesday", function (assert) { +test('weeks year starting wednesday', function (assert) { assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); @@ -214,7 +214,7 @@ test("weeks year starting wednesday", function (assert) { assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); -test("weeks year starting thursday", function (assert) { +test('weeks year starting thursday', function (assert) { assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); @@ -223,7 +223,7 @@ test("weeks year starting thursday", function (assert) { assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); -test("weeks year starting friday", function (assert) { +test('weeks year starting friday', function (assert) { assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); @@ -232,7 +232,7 @@ test("weeks year starting friday", function (assert) { assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); -test("weeks year starting saturday", function (assert) { +test('weeks year starting saturday', function (assert) { assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); @@ -240,7 +240,7 @@ test("weeks year starting saturday", function (assert) { assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); -test("weeks year starting sunday format", function (assert) { +test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1週', 'Jan 1 2012 應該是第 1週'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1週', 'Jan 7 2012 應該是第 1週'); assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2週', 'Jan 8 2012 應該是第 2週'); @@ -248,7 +248,7 @@ test("weeks year starting sunday format", function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3週', 'Jan 15 2012 應該是第 3週'); }); -test("lenient ordinal parsing", function (assert) { +test('lenient ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); @@ -262,7 +262,7 @@ test("lenient ordinal parsing", function (assert) { } }); -test("lenient ordinal parsing of number", function (assert) { +test('lenient ordinal parsing of number', function (assert) { var i, testMoment; for (i = 1; i <= 31; ++i) { testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); @@ -275,7 +275,7 @@ test("lenient ordinal parsing of number", function (assert) { } }); -test("meridiem invariant", function (assert) { +test('meridiem invariant', function (assert) { var h, m, t1, t2; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; m += 15) { @@ -287,7 +287,7 @@ test("meridiem invariant", function (assert) { } }); -test("strict ordinal parsing", function (assert) { +test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); diff --git a/src/test/moment/format.js b/src/test/moment/format.js index 0b2b1d5b0..d6f442b1e 100644 --- a/src/test/moment/format.js +++ b/src/test/moment/format.js @@ -115,15 +115,6 @@ test('default format', function (assert) { assert.ok(isoRegex.exec(moment().format()), 'default format (' + moment().format() + ') should match ISO'); }); -test('escaping quotes', function (assert) { - moment.locale('en'); - var date = moment([2012, 0]); - assert.equal(date.format('MMM \'YY'), 'Jan \'12', 'Should be able to format with single parenthesis'); - assert.equal(date.format('MMM "YY'), 'Jan "12', 'Should be able to format with double parenthesis'); - assert.equal(date.format('MMM \'YY'), 'Jan \'12', 'Should be able to format with single parenthesis'); - assert.equal(date.format('MMM "YY'), 'Jan "12', 'Should be able to format with double parenthesis'); -}); - test('toJSON', function (assert) { var supportsJson = typeof JSON !== 'undefined' && JSON.stringify && JSON.stringify.call, date = moment('2012-10-09T21:30:40.678+0100');