Commit 12b6a1d5 authored by Brandon Labuschagne's avatar Brandon Labuschagne

I18N datetime utility file

This is one of many MRs opened in order to improve the overall
internationalisation of the GitLab codebase.

This commit only targets Vanilla JS files.

i18n documentation
https://docs.gitlab.com/ee/development/i18n/externalization.html
parent 31c32db2
...@@ -81,7 +81,7 @@ export const getDayName = date => ...@@ -81,7 +81,7 @@ export const getDayName = date =>
*/ */
export const formatDate = datetime => { export const formatDate = datetime => {
if (_.isString(datetime) && datetime.match(/\d+-\d+\d+ /)) { if (_.isString(datetime) && datetime.match(/\d+-\d+\d+ /)) {
throw new Error('Invalid date'); throw new Error(__('Invalid date'));
} }
return dateFormat(datetime, 'mmm d, yyyy h:MMtt Z'); return dateFormat(datetime, 'mmm d, yyyy h:MMtt Z');
}; };
......
...@@ -5384,6 +5384,9 @@ msgstr "" ...@@ -5384,6 +5384,9 @@ msgstr ""
msgid "Invalid Login or password" msgid "Invalid Login or password"
msgstr "" msgstr ""
msgid "Invalid date"
msgstr ""
msgid "Invalid feature" msgid "Invalid feature"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment