[+] Create method to format date with moment
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import {Component, Prop, Vue} from 'vue-property-decorator';
|
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||||
import {Assignment, Course} from '@/components/app/app';
|
import {Assignment, Course} from '@/components/app/app';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
})
|
})
|
||||||
@@ -7,4 +8,14 @@ export default class UnreadEntry extends Vue
|
|||||||
{
|
{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@Prop({required: true}) assignment: Assignment;
|
@Prop({required: true}) assignment: Assignment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format a date to the displayed format
|
||||||
|
*
|
||||||
|
* @param date Date
|
||||||
|
*/
|
||||||
|
formatDate(date: Date)
|
||||||
|
{
|
||||||
|
return moment(date).format('MMM Do');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user