tslint changes

This commit is contained in:
Jeremy Simpson
2019-08-30 01:52:40 -07:00
parent 7603879d35
commit 7f7efbb94b
446 changed files with 70650 additions and 70661 deletions
@@ -4,52 +4,52 @@ import { MONTH_NAMES_EN } from '../../../common/constants';
import { getLocale } from '../../../client/clientUtils';
@Component({
selector: 'date-picker',
templateUrl: 'date-picker.pug',
selector: 'date-picker',
templateUrl: 'date-picker.pug',
})
export class DatePicker {
readonly days = times(31, i => i + 1);
readonly years: number[] = [];
readonly months = getMonthNames();
day = 0;
month = 0;
year = 0;
@Output() dateChange = new EventEmitter<string | undefined>();
constructor() {
const minYear = 1914;
const maxYear = (new Date()).getFullYear() - 6;
readonly days = times(31, i => i + 1);
readonly years: number[] = [];
readonly months = getMonthNames();
day = 0;
month = 0;
year = 0;
@Output() dateChange = new EventEmitter<string | undefined>();
constructor() {
const minYear = 1914;
const maxYear = (new Date()).getFullYear() - 6;
for (let year = maxYear; year >= minYear; year--) {
this.years.push(year);
}
}
@Input() get date() {
const date = createValidBirthDate(this.day, this.month, this.year);
return date && formatISODate(date);
}
set date(value) {
if (value) {
const { day, month, year } = parseISODate(value);
this.day = day;
this.month = month;
this.year = year;
}
}
change() {
this.dateChange.emit(this.date);
}
for (let year = maxYear; year >= minYear; year--) {
this.years.push(year);
}
}
@Input() get date() {
const date = createValidBirthDate(this.day, this.month, this.year);
return date && formatISODate(date);
}
set date(value) {
if (value) {
const { day, month, year } = parseISODate(value);
this.day = day;
this.month = month;
this.year = year;
}
}
change() {
this.dateChange.emit(this.date);
}
}
function getMonthNames() {
try {
const format = new Intl.DateTimeFormat(getLocale(), { month: 'long' });
try {
const format = new Intl.DateTimeFormat(getLocale(), { month: 'long' });
return times(12, i => {
const date = new Date(523456789);
date.setMonth(i);
return format.format(date);
});
} catch {
return MONTH_NAMES_EN;
}
return times(12, i => {
const date = new Date(523456789);
date.setMonth(i);
return format.format(date);
});
} catch {
return MONTH_NAMES_EN;
}
}