Prettier code cleanup for .ts files

See #182
This commit is contained in:
Michael Shamoon
2022-03-11 10:53:32 -08:00
parent d56c9dc94b
commit bd4a705769
159 changed files with 3882 additions and 2716 deletions

View File

@@ -1,16 +1,15 @@
import { Injectable } from "@angular/core";
import { NgbDateAdapter, NgbDateStruct } from "@ng-bootstrap/ng-bootstrap";
import { Injectable } from '@angular/core'
import { NgbDateAdapter, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap'
@Injectable()
export class ISODateAdapter extends NgbDateAdapter<string> {
fromModel(value: string | null): NgbDateStruct | null {
if (value) {
let date = new Date(value)
return {
day : date.getDate(),
month : date.getMonth() + 1,
year : date.getFullYear()
day: date.getDate(),
month: date.getMonth() + 1,
year: date.getFullYear(),
}
} else {
return null
@@ -19,7 +18,13 @@ export class ISODateAdapter extends NgbDateAdapter<string> {
toModel(date: NgbDateStruct | null): string | null {
if (date) {
return date.year.toString().padStart(4, '0') + "-" + date.month.toString().padStart(2, '0') + "-" + date.day.toString().padStart(2, '0')
return (
date.year.toString().padStart(4, '0') +
'-' +
date.month.toString().padStart(2, '0') +
'-' +
date.day.toString().padStart(2, '0')
)
} else {
return null
}