Commit e216f4c2 authored by Kev's avatar Kev

Add release date validation

parent 4d5abf60
<script>
import { GlBadge, GlIcon, GlLink, GlSafeHtmlDirective, GlButton } from '@gitlab/ui';
import { dateInWords } from '~/lib/utils/datetime_utility';
import { dateInWords, isValidDate } from '~/lib/utils/datetime_utility';
export default {
components: {
......@@ -22,6 +22,11 @@ export default {
releaseDate() {
const { published_at } = this.feature;
const date = new Date(published_at);
if (!isValidDate(date) || date.getTime() === 0) {
return '';
}
return dateInWords(date);
},
},
......
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