]> git.immae.eu Git - github/fretlink/time-picker.git/blobdiff - src/util/index.js
release 0.1.0
[github/fretlink/time-picker.git] / src / util / index.js
diff --git a/src/util/index.js b/src/util/index.js
new file mode 100644 (file)
index 0000000..5bc0a78
--- /dev/null
@@ -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;
+}