[+] Create method to format date with moment

This commit is contained in:
Hykilpikonna
2019-10-05 16:50:32 -04:00
parent 4633bd902c
commit 8a6af65786
@@ -1,5 +1,6 @@
import {Component, Prop, Vue} from 'vue-property-decorator';
import {Assignment, Course} from '@/components/app/app';
import moment from 'moment';
@Component({
})
@@ -7,4 +8,14 @@ export default class UnreadEntry extends Vue
{
// @ts-ignore
@Prop({required: true}) assignment: Assignment;
/**
* Format a date to the displayed format
*
* @param date Date
*/
formatDate(date: Date)
{
return moment(date).format('MMM Do');
}
}