Freigeben über


DateIntervalFormat.GetInstance Method

Definition

Overloads

GetInstance(String, Locale, DateIntervalInfo)

Construct a DateIntervalFormat from skeleton a DateIntervalInfo, and the given locale.

GetInstance(String, ULocale, DateIntervalInfo)

Construct a DateIntervalFormat from skeleton a DateIntervalInfo, and the given locale.

GetInstance(String, Locale)

Construct a DateIntervalFormat from skeleton and a given locale.

GetInstance(String, DateIntervalInfo)

Construct a DateIntervalFormat from skeleton DateIntervalInfo, and the default FORMAT locale.

GetInstance(String)

Construct a DateIntervalFormat from skeleton and the default FORMAT locale.

GetInstance(String, ULocale)

Construct a DateIntervalFormat from skeleton and a given locale.

GetInstance(String, Locale, DateIntervalInfo)

Construct a DateIntervalFormat from skeleton a DateIntervalInfo, and the given locale.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/util/Locale;Landroid/icu/text/DateIntervalInfo;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateIntervalFormat? GetInstance (string? skeleton, Java.Util.Locale? locale, Android.Icu.Text.DateIntervalInfo? dtitvinf);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/util/Locale;Landroid/icu/text/DateIntervalInfo;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)>]
static member GetInstance : string * Java.Util.Locale * Android.Icu.Text.DateIntervalInfo -> Android.Icu.Text.DateIntervalFormat

Parameters

skeleton
String

the skeleton on which interval format based.

locale
Locale

the given locale

dtitvinf
DateIntervalInfo

the DateIntervalInfo object to be adopted.

Returns

a date time interval formatter.

Attributes

Remarks

Construct a DateIntervalFormat from skeleton a DateIntervalInfo, and the given locale.

This is a convenient override of getInstance(String skeleton, ULocale locale, DateIntervalInfo dtitvinf)

Example code:{

Java documentation for android.icu.text.DateIntervalFormat.getInstance(java.lang.String, java.util.Locale, android.icu.text.DateIntervalInfo).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetInstance(String, ULocale, DateIntervalInfo)

Construct a DateIntervalFormat from skeleton a DateIntervalInfo, and the given locale.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Landroid/icu/util/ULocale;Landroid/icu/text/DateIntervalInfo;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateIntervalFormat? GetInstance (string? skeleton, Android.Icu.Util.ULocale? locale, Android.Icu.Text.DateIntervalInfo? dtitvinf);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Landroid/icu/util/ULocale;Landroid/icu/text/DateIntervalInfo;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)>]
static member GetInstance : string * Android.Icu.Util.ULocale * Android.Icu.Text.DateIntervalInfo -> Android.Icu.Text.DateIntervalFormat

Parameters

skeleton
String

the skeleton on which interval format based.

locale
ULocale

the given locale

dtitvinf
DateIntervalInfo

the DateIntervalInfo object to be adopted.

Returns

a date time interval formatter.

Attributes

Remarks

Construct a DateIntervalFormat from skeleton a DateIntervalInfo, and the given locale.

In this factory method, user provides its own date interval pattern information, instead of using those pre-defined data in resource file. This factory method is for powerful users who want to provide their own interval patterns.

There are pre-defined skeleton in DateFormat, such as MONTH_DAY, YEAR_MONTH_WEEKDAY_DAY etc.

Those skeletons have pre-defined interval patterns in resource files. Users are encouraged to use them. For example: DateIntervalFormat.getInstance(DateFormat.MONTH_DAY, false, loc,itvinf);

the DateIntervalInfo provides the interval patterns.

User are encouraged to set default interval pattern in DateIntervalInfo as well, if they want to set other interval patterns ( instead of reading the interval patterns from resource files). When the corresponding interval pattern for a largest calendar different field is not found ( if user not set it ), interval format fallback to the default interval pattern. If user does not provide default interval pattern, it fallback to "{date0} - {date1}"

Java documentation for android.icu.text.DateIntervalFormat.getInstance(java.lang.String, android.icu.util.ULocale, android.icu.text.DateIntervalInfo).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetInstance(String, Locale)

Construct a DateIntervalFormat from skeleton and a given locale.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/util/Locale;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateIntervalFormat? GetInstance (string? skeleton, Java.Util.Locale? locale);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/util/Locale;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)>]
static member GetInstance : string * Java.Util.Locale -> Android.Icu.Text.DateIntervalFormat

Parameters

skeleton
String

the skeleton on which interval format based.

locale
Locale

the given locale

Returns

a date time interval formatter.

Attributes

Remarks

Construct a DateIntervalFormat from skeleton and a given locale.

This is a convenient override of getInstance(String skeleton, ULocale locale)

Example code:{

Java documentation for android.icu.text.DateIntervalFormat.getInstance(java.lang.String, java.util.Locale).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetInstance(String, DateIntervalInfo)

Construct a DateIntervalFormat from skeleton DateIntervalInfo, and the default FORMAT locale.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Landroid/icu/text/DateIntervalInfo;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateIntervalFormat? GetInstance (string? skeleton, Android.Icu.Text.DateIntervalInfo? dtitvinf);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Landroid/icu/text/DateIntervalInfo;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)>]
static member GetInstance : string * Android.Icu.Text.DateIntervalInfo -> Android.Icu.Text.DateIntervalFormat

Parameters

skeleton
String

the skeleton on which interval format based.

dtitvinf
DateIntervalInfo

the DateIntervalInfo object to be adopted.

Returns

a date time interval formatter.

Attributes

Remarks

Construct a DateIntervalFormat from skeleton DateIntervalInfo, and the default FORMAT locale.

This is a convenient override of getInstance(String skeleton, ULocale locale, DateIntervalInfo dtitvinf) with the locale value as default FORMAT locale.

Java documentation for android.icu.text.DateIntervalFormat.getInstance(java.lang.String, android.icu.text.DateIntervalInfo).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetInstance(String)

Construct a DateIntervalFormat from skeleton and the default FORMAT locale.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateIntervalFormat? GetInstance (string? skeleton);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)>]
static member GetInstance : string -> Android.Icu.Text.DateIntervalFormat

Parameters

skeleton
String

the skeleton on which interval format based.

Returns

a date time interval formatter.

Attributes

Remarks

Construct a DateIntervalFormat from skeleton and the default FORMAT locale.

This is a convenient override of getInstance(String skeleton, ULocale locale) with the value of locale as default FORMAT locale.

Java documentation for android.icu.text.DateIntervalFormat.getInstance(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetInstance(String, ULocale)

Construct a DateIntervalFormat from skeleton and a given locale.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Landroid/icu/util/ULocale;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)]
public static Android.Icu.Text.DateIntervalFormat? GetInstance (string? skeleton, Android.Icu.Util.ULocale? locale);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Landroid/icu/util/ULocale;)Landroid/icu/text/DateIntervalFormat;", "", ApiSince=24)>]
static member GetInstance : string * Android.Icu.Util.ULocale -> Android.Icu.Text.DateIntervalFormat

Parameters

skeleton
String

the skeleton on which interval format based.

locale
ULocale

the given locale

Returns

a date time interval formatter.

Attributes

Remarks

Construct a DateIntervalFormat from skeleton and a given locale.

In this factory method, the date interval pattern information is load from resource files. Users are encouraged to created date interval formatter this way and to use the pre-defined skeleton macros.

There are pre-defined skeletons in DateFormat, such as MONTH_DAY, YEAR_MONTH_WEEKDAY_DAY etc.

Those skeletons have pre-defined interval patterns in resource files. Users are encouraged to use them. For example: DateIntervalFormat.getInstance(DateFormat.MONTH_DAY, false, loc);

The given Locale provides the interval patterns. For example, for en_GB, if skeleton is YEAR_ABBR_MONTH_WEEKDAY_DAY, which is "yMMMEEEd", the interval patterns defined in resource file to above skeleton are: "EEE, d MMM, yyyy - EEE, d MMM, yyyy" for year differs, "EEE, d MMM - EEE, d MMM, yyyy" for month differs, "EEE, d - EEE, d MMM, yyyy" for day differs,

Java documentation for android.icu.text.DateIntervalFormat.getInstance(java.lang.String, android.icu.util.ULocale).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to