import * as i0 from '@angular/core';
import { Pipe } from '@angular/core';
import * as i1 from '@ngx-translate/core';
export { S as SafeUrlPipe } from './yuuvis-media-viewer-yuuvis-media-viewer-D4GqyhDf.mjs';

const predefinedFormats = {
    short: {
        timeStyle: 'short',
        dateStyle: 'short'
    },
    medium: {
        timeStyle: 'medium',
        dateStyle: 'medium'
    },
    shortDate: {
        dateStyle: 'short'
    }
};
class LocaleDatePipe {
    translate;
    constructor(translate) {
        this.translate = translate;
    }
    transform(value, format = 'short') {
        if (!value)
            return '';
        else {
            try {
                return new Intl.DateTimeFormat(this.translate.currentLang, predefinedFormats[format]).format(!(value instanceof Date) ? new Date(value) : value);
            }
            catch (e) {
                console.error(e);
                return '';
            }
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: LocaleDatePipe, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
    static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: LocaleDatePipe, isStandalone: true, name: "localeDate" });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: LocaleDatePipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'localeDate',
                    standalone: true
                }]
        }], ctorParameters: () => [{ type: i1.TranslateService }] });

export { LocaleDatePipe };
//# sourceMappingURL=yuuvis-media-viewer-index-DH3vkfvQ.mjs.map
