DateIntervalFormat.GetInstance Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 |
GetInstance(String) |
Construct a DateIntervalFormat from skeleton and the default |
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:{
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}"
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:{
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.
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,
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.