Commit e216f4c2 authored by Kev's avatar Kev

Add release date validation

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