You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aConnect-UX/src/app/utils/app.constants.ts

27 lines
617 B
TypeScript

import { AbstractControl, ValidationErrors, ValidatorFn } from "@angular/forms";
export const CONSTANTS = {
POR_ORGACODE: '0005',
};
export const pageSizeOptions = [
{ label: '5 items', value: 5 },
{ label: '10 items', value: 10 },
{ label: '20 items', value: 20 }
];
export const toDateAfterFromDateValidator: ValidatorFn = (
group: AbstractControl
): ValidationErrors | null => {
const fromDate = group.get('fromDate')?.value;
const toDate = group.get('toDate')?.value;
if (!fromDate || !toDate) {
return null;
}
return toDate >= fromDate
? null
: { toDateInvalid: true };
};