{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

CalendarModelKt

public final class CalendarModelKt


Summary

Public methods

static final @NonNull String
@ExperimentalMaterial3Api
formatWithSkeleton(
    long utcTimeMillis,
    @NonNull String skeleton,
    @NonNull CalendarLocale locale,
    @NonNull Map<@NonNull String, @NonNull Object> cache
)

Formats a UTC timestamp into a string with a given date format skeleton.

Public methods

formatWithSkeleton

@ExperimentalMaterial3Api
public static final @NonNull String formatWithSkeleton(
    long utcTimeMillis,
    @NonNull String skeleton,
    @NonNull CalendarLocale locale,
    @NonNull Map<@NonNull String, @NonNull Object> cache
)

Formats a UTC timestamp into a string with a given date format skeleton.

A skeleton is similar to, and uses the same format characters as described in Unicode Technical Standard #35

One difference is that order is irrelevant. For example, "MMMMd" will return "MMMM d" in the en_US locale, but "d. MMMM" in the de_CH locale.

Parameters
long utcTimeMillis

a UTC timestamp to format (milliseconds from epoch)

@NonNull String skeleton

a date format skeleton

@NonNull CalendarLocale locale

the CalendarLocale to use when formatting the given timestamp

@NonNull Map<@NonNull String, @NonNull Object> cache

a MutableMap for caching formatter related results for better performance