Przeglądaj źródła

Fixes #185 - wrong relative date

main
Eric Amodio 7 lat temu
rodzic
commit
df5bf06646
1 zmienionych plików z 8 dodań i 6 usunięć
  1. +8
    -6
      src/system/date.ts

+ 8
- 6
src/system/date.ts Wyświetl plik

@ -79,6 +79,11 @@ function buildDistanceInWordsLocale() {
function localize(token: string, count: number, options: any) {
options = options || {};
if (count === 12 && token === 'xMonths') {
token = 'aboutXYears';
count = 1;
}
const result = distanceInWordsLocale[token];
let value: string;
@ -86,11 +91,6 @@ function buildDistanceInWordsLocale() {
value = result;
}
else {
if (count === 12 && token === 'xMonths') {
token = 'aboutXYears';
count = 1;
}
if (count === 1) {
value = result.one;
}
@ -141,7 +141,9 @@ export namespace Dates {
export function toFormatter(date: Date): IDateFormatter {
return {
fromNow: () => _fromNow(date, formatterOptions),
fromNow: () => {
return _fromNow(date, formatterOptions);
},
format: (format: string) => _format(date, format)
};
}

Ładowanie…
Anuluj
Zapisz