Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.filter = (date: Moment, type: MatDatetimepickerFilterType) => {
switch (type) {
case MatDatetimepickerFilterType.DATE:
return date.year() % 2 === 0 &&
date.month() % 2 === 0 &&
date.date() % 2 === 0;
case MatDatetimepickerFilterType.HOUR:
return date.hour() % 2 === 0;
case MatDatetimepickerFilterType.MINUTE:
return date.minute() % 2 === 0;
}
};
this.filter = (date: Date, type: MatDatetimepickerFilterType) => {
switch (type) {
case MatDatetimepickerFilterType.DATE:
return date.getUTCFullYear() % 2 === 0 &&
date.getMonth() % 2 === 0 &&
date.getDate() % 2 === 0;
case MatDatetimepickerFilterType.HOUR:
return date.getHours() % 2 === 0;
case MatDatetimepickerFilterType.MINUTE:
return date.getMinutes() % 2 === 0;
}
};
this.filter = (date: Date, type: MatDatetimepickerFilterType) => {
switch (type) {
case MatDatetimepickerFilterType.DATE:
return date.getUTCFullYear() % 2 === 0 &&
date.getMonth() % 2 === 0 &&
date.getDate() % 2 === 0;
case MatDatetimepickerFilterType.HOUR:
return date.getHours() % 2 === 0;
case MatDatetimepickerFilterType.MINUTE:
return date.getMinutes() % 2 === 0;
}
};
this.filter = (date: Moment, type: MatDatetimepickerFilterType) => {
switch (type) {
case MatDatetimepickerFilterType.DATE:
return date.year() % 2 === 0 &&
date.month() % 2 === 0 &&
date.date() % 2 === 0;
case MatDatetimepickerFilterType.HOUR:
return date.hour() % 2 === 0;
case MatDatetimepickerFilterType.MINUTE:
return date.minute() % 2 === 0;
}
};
this.filter = (date: Moment, type: MatDatetimepickerFilterType) => {
switch (type) {
case MatDatetimepickerFilterType.DATE:
return date.year() % 2 === 0 &&
date.month() % 2 === 0 &&
date.date() % 2 === 0;
case MatDatetimepickerFilterType.HOUR:
return date.hour() % 2 === 0;
case MatDatetimepickerFilterType.MINUTE:
return date.minute() % 2 === 0;
}
};
this.filter = (date: Date, type: MatDatetimepickerFilterType) => {
switch (type) {
case MatDatetimepickerFilterType.DATE:
return date.getUTCFullYear() % 2 === 0 &&
date.getMonth() % 2 === 0 &&
date.getDate() % 2 === 0;
case MatDatetimepickerFilterType.HOUR:
return date.getHours() % 2 === 0;
case MatDatetimepickerFilterType.MINUTE:
return date.getMinutes() % 2 === 0;
}
};