Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,21 @@ export class ScheduledComponent implements OnInit {
ngOnInit(): void {
}

formatDate(date: string): string {
if (!date)
return '';
if (date.length == 10)
date = date + ' 00:00';
return new Date(date).toLocaleDateString()
}

formatTime(date: string): string {
if (!date)
return '';
// Get the locale specific time and remove the seconds
const t = new Date(date);
const tWithSecs = t.toLocaleTimeString() + ' ';
return tWithSecs.replace(/:.. /, ' ');
}

}