diff --git a/client/app/components/TimeAgo.jsx b/client/app/components/TimeAgo.jsx index 32089729aa..fd4e08b2ca 100644 --- a/client/app/components/TimeAgo.jsx +++ b/client/app/components/TimeAgo.jsx @@ -8,24 +8,6 @@ import { clientConfig } from '@/services/auth'; import useForceUpdate from '@/lib/hooks/useForceUpdate'; import Tooltip from 'antd/lib/tooltip'; -moment.updateLocale('en', { - relativeTime: { - future: '%s', - past: '%s', - s: 'just now', - m: 'a minute ago', - mm: '%d minutes ago', - h: 'an hour ago', - hh: '%d hours ago', - d: 'a day ago', - dd: '%d days ago', - M: 'a month ago', - MM: '%d months ago', - y: 'a year ago', - yy: '%d years ago', - }, -}); - function toMoment(value) { value = !isNil(value) ? moment(value) : null; return value && value.isValid() ? value : null; diff --git a/client/app/config/index.js b/client/app/config/index.js index a38c5cd839..4901a0c192 100644 --- a/client/app/config/index.js +++ b/client/app/config/index.js @@ -30,6 +30,7 @@ import registerDirectives from '@/directives'; import markdownFilter from '@/filters/markdown'; import dateTimeFilter from '@/filters/datetime'; import './antd-spinner'; +import moment from 'moment'; const logger = debug('redash:config'); @@ -41,6 +42,24 @@ Pace.options.shouldHandlePushState = (prevUrl, newUrl) => { return prevPrefix !== newPrefix; }; +moment.updateLocale('en', { + relativeTime: { + future: '%s', + past: '%s', + s: 'just now', + m: 'a minute ago', + mm: '%d minutes ago', + h: 'an hour ago', + hh: '%d hours ago', + d: 'a day ago', + dd: '%d days ago', + M: 'a month ago', + MM: '%d months ago', + y: 'a year ago', + yy: '%d years ago', + }, +}); + const requirements = [ ngRoute, ngResource,