|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
const currentDate = new Date().toISOString();
|
|
|
|
|
|
|
|
|
|
if (!fromDate || !toDate) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(toDate < fromDate)
|
|
|
|
|
return { toDateInvalid: true }
|
|
|
|
|
else if(toDate >= currentDate)
|
|
|
|
|
return { toDateGreaterThanToday: true }
|
|
|
|
|
else
|
|
|
|
|
return null
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const EXCEL_FILE_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
|
|
|
|
|
|
|
|
|
export const EXCEL_FILE_EXTENSION = '.xlsx';
|
|
|
|
|
|
|
|
|
|
export const LOGGING_DETAILS_FILE_NAME = 'logging-manager-details'
|