dist/ngu-utility.esm.js
function getDateTranslation(date, locale, name, width, form, extended) {
    switch (name) {
        case TranslationType.Months:
            return getLocaleMonthNames(locale, form, width)[date.getMonth()];
        case TranslationType.Days:
            return getLocaleDayNames(locale, form, width)[date.getDay()];
        case TranslationType.DayPeriods:
            var /** @type {?} */ currentHours_1 = date.getHours();
            var /** @type {?} */ currentMinutes_1 = date.getMinutes();
            if (extended) {
                var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);
                var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);
                var /** @type {?} */ result_1;
                rules.forEach(function (rule, index) {
                    if (Array.isArray(rule)) {
                        // morning, afternoon, evening, night
                        var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;
                        var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;
                        if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&
                            (currentHours_1 < hoursTo ||
                                (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                    else {
                        // noon or midnight
                        var hours = rule.hours, minutes = rule.minutes;
                        if (hours === currentHours_1 && minutes === currentMinutes_1) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                });
                if (result_1) {
                    return result_1;
                }
            }
            // if no rules for the day periods, we use am/pm by default
            return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];
        case TranslationType.Eras:
            return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];
    }
}
function getDateTranslation(date, locale, name, width, form, extended) {
    switch (name) {
        case TranslationType.Months:
            return getLocaleMonthNames(locale, form, width)[date.getMonth()];
        case TranslationType.Days:
            return getLocaleDayNames(locale, form, width)[date.getDay()];
        case TranslationType.DayPeriods:
            var /** @type {?} */ currentHours_1 = date.getHours();
            var /** @type {?} */ currentMinutes_1 = date.getMinutes();
            if (extended) {
                var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);
                var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);
                var /** @type {?} */ result_1;
                rules.forEach(function (rule, index) {
                    if (Array.isArray(rule)) {
                        // morning, afternoon, evening, night
                        var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;
                        var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;
                        if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&
                            (currentHours_1 < hoursTo ||
                                (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                    else {
                        // noon or midnight
                        var hours = rule.hours, minutes = rule.minutes;
                        if (hours === currentHours_1 && minutes === currentMinutes_1) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                });
                if (result_1) {
                    return result_1;
                }
            }
            // if no rules for the day periods, we use am/pm by default
            return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];
        case TranslationType.Eras:
            return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];
    }
}
function getDateTranslation ( date , locale , name , width , form , extended ) { switch ( name ) { case TranslationType . Months : return getLocaleMonthNames ( locale , form , width ) [ date . getMonth ( ) ] ; case TranslationType . Days : return getLocaleDayNames ( locale , form , width ) [ date . getDay ( ) ] ; case TranslationType . DayPeriods : var /** @type {?} */ currentHours_1 = date . getHours ( ) ; var /** @type {?} */ currentMinutes_1 = date . getMinutes ( ) ; if ( extended ) { var /** @type {?} */ rules = getLocaleExtraDayPeriodRules ( locale ) ; var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods ( locale , form , width ) ; var /** @type {?} */ result_1 ; rules . forEach ( function ( rule , index ) { if ( Array . isArray ( rule ) ) { // morning, afternoon, evening, night var _a = rule [ 0 ] , hoursFrom = _a . hours , minutesFrom = _a . minutes ; var _b = rule [ 1 ] , hoursTo = _b . hours , minutesTo = _b . minutes ; if ( currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom && ( currentHours_1 < hoursTo || ( currentHours_1 === hoursTo && currentMinutes_1 < minutesTo ) ) ) { result_1 = dayPeriods_1 [ index ] ; } } else { // noon or midnight var hours = rule . hours , minutes = rule . minutes ; if ( hours === currentHours_1 && minutes === currentMinutes_1 ) { result_1 = dayPeriods_1 [ index ] ; } } } ) ; if ( result_1 ) { return result_1 ; } } // if no rules for the day periods, we use am/pm by default return getLocaleDayPeriods ( locale , form , /** @type {?} */ ( width ) ) [ currentHours_1 < 12 ? 0 : 1 ] ; case TranslationType . Eras : return getLocaleEraNames ( locale , /** @type {?} */ ( width ) ) [ date . getFullYear ( ) <= 0 ? 0 : 1 ] ; } }
Returns the locale translation of a date for a given form, type and width
@param {?} date
@param {?} locale
@param {?} name
@param {?} width
@param {?} form
@param {?} extended
@return {?}
Returns the locale translation of a date for a given form type and width