diff options
Diffstat (limited to 'src/util/index.js')
-rw-r--r-- | src/util/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/index.js b/src/util/index.js new file mode 100644 index 0000000..5bc0a78 --- /dev/null +++ b/src/util/index.js | |||
@@ -0,0 +1,8 @@ | |||
1 | import DateTimeFormat from 'gregorian-calendar-format'; | ||
2 | |||
3 | export function getFormatter(format, locale) { | ||
4 | if (typeof format === 'string') { | ||
5 | return new DateTimeFormat(format, locale.format); | ||
6 | } | ||
7 | return format; | ||
8 | } | ||