diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/assets/javascripts/vue_shared/components/user_date.vue | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) | |
download | gitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/user_date.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/user_date.vue | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_shared/components/user_date.vue b/app/assets/javascripts/vue_shared/components/user_date.vue index 38dddbf72c2..33531cc3278 100644 --- a/app/assets/javascripts/vue_shared/components/user_date.vue +++ b/app/assets/javascripts/vue_shared/components/user_date.vue @@ -1,7 +1,7 @@ <script> import { formatDate } from '~/lib/utils/datetime_utility'; import { __ } from '~/locale'; -import { SHORT_DATE_FORMAT } from '../constants'; +import { SHORT_DATE_FORMAT, DATE_FORMATS } from '../constants'; export default { props: { @@ -10,6 +10,12 @@ export default { required: false, default: null, }, + dateFormat: { + type: String, + required: false, + default: SHORT_DATE_FORMAT, + validator: (dateFormat) => DATE_FORMATS.includes(dateFormat), + }, }, computed: { formattedDate() { @@ -17,7 +23,7 @@ export default { if (date === null) { return __('Never'); } - return formatDate(new Date(date), SHORT_DATE_FORMAT); + return formatDate(new Date(date), this.dateFormat); }, }, }; |