import { systemCurrency } from "libs/ngx-hbor-lib/src/functions/number-functions"; export function decimalComparator(propA, propB) { const propAFormated = +systemCurrency(propA); const propBFormated = +systemCurrency(propB); if (propAFormated < propBFormated) { return -1; } if (propAFormated > propBFormated) { return 1; } } export function dateComparator(propA: string, propB: string) { const propAArray = propA.split('.') let dayA = ''; let monthA = ''; const yearA = propAArray[2]; const propBArray = propB.split('.') let dayB = ''; let monthB = ''; const yearB = propBArray[2]; dayA = propAArray[0] + '-'; monthA = propAArray[1] + '-'; dayB = propBArray[0] + '-'; monthB = propBArray[1] + '-'; // Chorome const propAFormated = new Date(monthA + dayA + yearA).getTime(); const propBFormated = new Date(monthB + dayB + yearB).getTime(); if (propAFormated < propBFormated) { return -1; } if (propAFormated > propBFormated) { return 1; } }