import "moment/locale/da";
import "moment/locale/de";
import "moment/locale/fi";
import "moment/locale/fr";
import "moment/locale/nb";
import "moment/locale/nl";
import "moment/locale/sv";
import moment from "moment/moment";
export class DateFormatter {
    constructor(language = 'en') {
        this.language = language;
    }
    formatDate(date, dateFormat) {
        if (date) {
            return moment(date).locale(this.getLanguage()).format(dateFormat);
        }
        return '';
    }
    parseDate(date, dateFormat) {
        if (date) {
            return moment(date, dateFormat).toDate();
        }
        return null;
    }
    getLanguage() {
        if (this.language === 'no') {
            return 'nb';
        }
        return this.language;
    }
    getDateFormat(type) {
        return ({
            date: 'L',
            time: 'LT',
            week: '[w] W GGGG',
            month: 'MM/YYYY',
            quarter: '[Q]Q YYYY',
            year: 'YYYY',
            datetime: 'L - LT',
        }[type] || 'L - LT');
    }
}
