Interface DateTimeFormatOptions


@JsType(isNative=true, namespace="<global>") public interface DateTimeFormatOptions
Mapping for date time format options passed to DateTimeFormat constructors.

In addition to the actual mappings, this class implements the builder pattern using enums to create the options easily and in a type-safe manner. Some enums are shared with other format option builders of the Intl module and may contain more values than intended for the given method. In that case the allowed values are listed on the method. In all other cases all enum values are applicable.

var date = new JsDate(2012, 11, 17, 4, 0, 42);

console.log(dateTimeFormat("en-GB", dateTimeFormatOptions()
        .hour(numeric)
        .hourCycle(h12)
        .dayPeriod(short_)
        .timeZone("UTC")).format(date));
// 4 at night" (same formatting in en-GB for all dayPeriod values)

console.log(dateTimeFormat("fr", dateTimeFormatOptions()
        .hour(numeric)
        .hourCycle(h12)
        .dayPeriod(narrow)
        .timeZone("UTC")).format(date));
// "4 mat." (same output in French for both narrow/short dayPeriod)

console.log(dateTimeFormat("fr", dateTimeFormatOptions()
        .hour(numeric)
        .hourCycle(h12)
        .dayPeriod(long_)
        .timeZone("UTC")).format(date));
// "4 du matin"
See Also: