export class DateParser {
    static tryParse(value, format, locale) {
        try {
            const date = this.parse(value, format, locale);
            if (!this.isValidDate(date)) {
                return null;
            }
            return date;
        }
        catch {
            return null;
        }
    }
    static parse(value, format, locale) {
        return new Date(Date.parse(value));
    }
    static isValidDate(date) {
        return !isNaN(date.getTime());
    }
}
//# sourceMappingURL=DateParser.js.map