[O] Remove toChartDate, use timestamp instead
This commit is contained in:
@@ -2,20 +2,6 @@ import moment from 'moment';
|
||||
|
||||
export class FormatUtils
|
||||
{
|
||||
/**
|
||||
* Convert date format to yyyy-mm-dd
|
||||
*
|
||||
* @param _date Date
|
||||
*/
|
||||
public static toChartDate(_date: string | Date)
|
||||
{
|
||||
// Convert to Date
|
||||
let date: Date = _date instanceof Date ? _date : new Date(_date);
|
||||
|
||||
// Convert to yyyy-mm-dd
|
||||
return moment(date).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit string length
|
||||
*
|
||||
|
||||
@@ -40,7 +40,7 @@ export default class CourseScatter extends Vue
|
||||
{
|
||||
formatter: (name: any) => moment(name).format('MMM DD')
|
||||
},
|
||||
max: FormatUtils.toChartDate(new Date())
|
||||
max: new Date().getTime()
|
||||
},
|
||||
|
||||
// Y axis represents GPAs and MaxGPAs
|
||||
@@ -160,6 +160,6 @@ export default class CourseScatter extends Vue
|
||||
private static assignmentsData(assignments: Assignment[])
|
||||
{
|
||||
return assignments.filter(a => a.complete == 'Complete')
|
||||
.map(a => [FormatUtils.toChartDate(a.date), (a.score / a.scoreMax * 100).toFixed(2), a.description]);
|
||||
.map(a => [a.time, (a.score / a.scoreMax * 100).toFixed(2), a.description]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user