This adds moment to perfect date/time sorting with tabulator!

This commit is contained in:
Jonathan Rosenbaum
2017-10-30 03:01:55 +00:00
parent f15d312e5a
commit 4bb9b043ad
568 changed files with 166883 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { makeGetSet } from '../moment/get-set';
import { addFormatToken } from '../format/format';
import { addUnitAlias } from './aliases';
import { addUnitPriority } from './priorities';
import { addRegexToken, match1to2, match2 } from '../parse/regex';
import { addParseToken } from '../parse/token';
import { SECOND } from './constants';
// FORMATTING
addFormatToken('s', ['ss', 2], 0, 'second');
// ALIASES
addUnitAlias('second', 's');
// PRIORITY
addUnitPriority('second', 15);
// PARSING
addRegexToken('s', match1to2);
addRegexToken('ss', match1to2, match2);
addParseToken(['s', 'ss'], SECOND);
// MOMENTS
export var getSetSecond = makeGetSet('Seconds', false);