diff --git a/src/locale/lv.js b/src/locale/lv.js index b06bd65a..7f800961 100644 --- a/src/locale/lv.js +++ b/src/locale/lv.js @@ -17,6 +17,21 @@ const locale = { LL: 'YYYY. [gada] D. MMMM', LLL: 'YYYY. [gada] D. MMMM, HH:mm', LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm' + }, + relativeTime: { + future: 'pēc %s', + past: 'pirms %s', + s: 'dažām sekundēm', + m: 'minūtes', + mm: '%d minūtēm', + h: 'stundas', + hh: '%d stundām', + d: 'dienas', + dd: '%d dienām', + M: 'mēneša', + MM: '%d mēnešiem', + y: 'gada', + yy: '%d gadiem' } } diff --git a/src/plugin/customParseFormat/index.js b/src/plugin/customParseFormat/index.js index cc338b0d..940bb43a 100644 --- a/src/plugin/customParseFormat/index.js +++ b/src/plugin/customParseFormat/index.js @@ -133,7 +133,7 @@ function correctHours(time) { } function makeParser(format) { - format = u(format, locale.formats) + format = u(format, locale && locale.formats) const array = format.match(formattingTokens) const { length } = array for (let i = 0; i < length; i += 1) { @@ -224,6 +224,8 @@ export default (o, C, d) => { if (isStrict && date !== this.format(format)) { this.$d = new Date('') } + // reset global locale to make parallel unit test + locale = undefined } else if (format instanceof Array) { const len = format.length for (let i = 1; i <= len; i += 1) {