X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Futil%2Findex.js;fp=src%2Futil%2Findex.js;h=5bc0a7836eb2884f228ab74950415763b764bcf3;hb=02de449a0474765a4796fa607e7e3922252f574f;hp=0000000000000000000000000000000000000000;hpb=1f336fabc9135ac971e53d9c2ae407db69b8f096;p=github%2Ffretlink%2Ftime-picker.git 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 @@ +import DateTimeFormat from 'gregorian-calendar-format'; + +export function getFormatter(format, locale) { + if (typeof format === 'string') { + return new DateTimeFormat(format, locale.format); + } + return format; +}