Home
last modified time | relevance | path

Searched refs:DateFormat (Results 1 – 25 of 183) sorted by relevance

12345678

/aosp12/frameworks/base/core/tests/coretests/src/android/text/format/
H A DDateFormatTest.java52 assertTrue(DateFormat.hasDesignator("hh:mm:ss", DateFormat.MINUTE)); in testHasDesignator()
53 assertTrue(DateFormat.hasDesignator("myyyy", DateFormat.MINUTE)); in testHasDesignator()
54 assertTrue(DateFormat.hasDesignator("mmm", DateFormat.MINUTE)); in testHasDesignator()
56 assertFalse(DateFormat.hasDesignator("hh:MM:ss", DateFormat.MINUTE)); in testHasDesignator()
61 assertTrue(DateFormat.hasDesignator("hh:mm 'LOL'", DateFormat.MINUTE)); in testHasDesignatorEscaped()
63 assertFalse(DateFormat.hasDesignator("hh:mm 'yyyy'", DateFormat.YEAR)); in testHasDesignatorEscaped()
68 assertFalse(DateFormat.is24HourLocale(Locale.US)); in testIs24HourLocale()
126 DateFormat.getDateFormatOrder("'"); in testGetDateFormatOrder()
132 DateFormat.getDateFormatOrder("yyyy'"); in testGetDateFormatOrder()
138 DateFormat.getDateFormatOrder("yyyy'MMM"); in testGetDateFormatOrder()
[all …]
H A DDateUtilsTest.java34 import java.text.DateFormat;
121 DateFormat.set24HourTimePref(null); in testFormatSameDayTime()
131 java.text.DateFormat.FULL)); in testFormatSameDayTime()
133 fixedTime, java.text.DateFormat.DEFAULT, java.text.DateFormat.FULL)); in testFormatSameDayTime()
135 fixedTime, java.text.DateFormat.LONG, java.text.DateFormat.FULL)); in testFormatSameDayTime()
137 fixedTime, java.text.DateFormat.MEDIUM, java.text.DateFormat.FULL)); in testFormatSameDayTime()
139 fixedTime, java.text.DateFormat.SHORT, java.text.DateFormat.FULL)); in testFormatSameDayTime()
146 fixedTime, java.text.DateFormat.FULL, java.text.DateFormat.DEFAULT)); in testFormatSameDayTime()
148 fixedTime, java.text.DateFormat.FULL, java.text.DateFormat.LONG)); in testFormatSameDayTime()
150 fixedTime, java.text.DateFormat.FULL, java.text.DateFormat.MEDIUM)); in testFormatSameDayTime()
[all …]
/aosp12/frameworks/base/core/java/android/text/format/
H A DDateFormat.java66 public class DateFormat { class
220 final java.text.DateFormat natural = in is24HourLocale()
221 java.text.DateFormat.getTimeInstance(java.text.DateFormat.LONG, locale); in is24HourLocale()
281 public static java.text.DateFormat getTimeFormat(Context context) { in getTimeFormat()
319 public static java.text.DateFormat getDateFormat(Context context) { in getDateFormat()
321 return java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT, locale); in getDateFormat()
330 public static java.text.DateFormat getLongDateFormat(Context context) { in getLongDateFormat()
332 return java.text.DateFormat.getDateInstance(java.text.DateFormat.LONG, locale); in getLongDateFormat()
343 return java.text.DateFormat.getDateInstance(java.text.DateFormat.MEDIUM, locale); in getMediumDateFormat()
406 java.text.DateFormat df = java.text.DateFormat.getDateInstance( in getDateFormatString()
[all …]
H A DDateTimeFormat.java19 import android.icu.text.DateFormat;
35 static class FormatterCache extends LruCache<String, DateFormat> {
49 DateFormat formatter = CACHED_FORMATTERS.get(key); in format()
/aosp12/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/incident/
H A DFormatting.java25 import java.text.DateFormat;
34 private final DateFormat mDateFormat;
35 private final DateFormat mTimeFormat;
43 mDateFormat = android.text.format.DateFormat.getDateFormat(context); in Formatting()
44 mTimeFormat = android.text.format.DateFormat.getTimeFormat(context); in Formatting()
/aosp12/packages/apps/WallpaperPicker2/src/com/android/wallpaper/util/
H A DTimeUtils.java22 import android.text.format.DateFormat;
42 return DateFormat.format( in getFormattedTime()
43 DateFormat.is24HourFormat(context) in getFormattedTime()
56 return DateFormat.format( in getDoubleLineFormattedTime()
57 DateFormat.is24HourFormat(context) in getDoubleLineFormattedTime()
/aosp12/packages/apps/DocumentsUI/src/com/android/documentsui/inspector/
H A DDateUtils.java20 import android.text.format.DateFormat;
38 int formatRes = DateFormat.is24HourFormat(context) in formatDate()
41 String format = DateFormat.getBestDateTimePattern( in formatDate()
44 return DateFormat.format(format, date).toString(); in formatDate()
/aosp12/packages/apps/Gallery2/src/com/android/gallery3d/ingest/data/
H A DSimpleDate.java22 import java.text.DateFormat;
54 DateFormat.getDateInstance(DateFormat.SHORT).format(timestamp); in setTimestamp()
123 DateFormat.getDateInstance(DateFormat.SHORT).format(timestamp); in toString()
/aosp12/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/
H A DVariableDateViewController.kt23 import android.icu.text.DateFormat
44 internal fun getTextForFormat(date: Date?, format: DateFormat): String {
51 internal fun getFormatFromPattern(pattern: String?): DateFormat {
56 val format = DateFormat.getInstanceForSkeleton(pattern, l)
61 private val EMPTY_FORMAT: DateFormat = object : DateFormat() {
83 private var dateFormat: DateFormat? = null
/aosp12/packages/apps/Settings/src/com/android/settings/accounts/
H A DAccountPreferenceBase.java28 import android.text.format.DateFormat;
51 private java.text.DateFormat mDateFormat;
52 private java.text.DateFormat mTimeFormat;
94 mDateFormat = DateFormat.getDateFormat(activity); in onActivityCreated()
95 mTimeFormat = DateFormat.getTimeFormat(activity); in onActivityCreated()
/aosp12/art/test/092-locale/src/
H A DMain.java17 import java.text.DateFormat;
74 DateFormat fmt = DateFormat.getDateInstance(DateFormat.FULL, usa); in testCalendar()
90 fmt = DateFormat.getDateInstance(DateFormat.FULL, usa); in testCalendar()
/aosp12/packages/apps/Contacts/src/com/android/contacts/datepicker/
H A DDatePickerDialog.java34 import java.text.DateFormat;
56 private final DateFormat mTitleDateFormat;
57 private final DateFormat mTitleNoYearDateFormat;
122 mTitleDateFormat = DateFormat.getDateInstance(DateFormat.FULL); in DatePickerDialog()
158 final DateFormat dateFormat = in updateTitle()
/aosp12/packages/apps/Contacts/src/com/android/contacts/util/
H A DDateUtils.java20 import android.text.format.DateFormat;
169 final java.text.DateFormat outFormat; in formatDate()
174 longForm ? DateFormat.getLongDateFormat(context) : in formatDate()
175 DateFormat.getDateFormat(context); in formatDate()
184 char[] dateFormatOrder = DateFormat.getDateFormatOrder(context); in isMonthBeforeDay()
203 public static java.text.DateFormat getLocalizedDateFormatWithoutYear(Context context) { in getLocalizedDateFormatWithoutYear()
205 java.text.DateFormat.LONG)).toPattern(); in getLocalizedDateFormatWithoutYear()
/aosp12/packages/apps/TV/src/com/android/tv/guide/
H A DTimeListAdapter.java21 import android.text.format.DateFormat;
59 mTimePatternSameDay = DateFormat.getBestDateTimePattern(locale, TIME_PATTERN_SAME_DAY); in TimeListAdapter()
61 DateFormat.getBestDateTimePattern(locale, TIME_PATTERN_DIFFERENT_DAY); in TimeListAdapter()
88 timeString = DateFormat.format(mTimePatternSameDay, timeDate).toString(); in onBindViewHolder()
90 timeString = DateFormat.format(mTimePatternDifferentDay, timeDate).toString(); in onBindViewHolder()
/aosp12/system/timezone/input_tools/android/tzlookup_generator/src/main/java/com/android/libcore/timezone/tzlookup/
H A DUtils.java19 import java.text.DateFormat;
38 private static final DateFormat UTC_FORMAT;
40 UTC_FORMAT = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/utils/
H A DPowerUtil.java20 import android.icu.text.DateFormat;
221 String skeleton = android.text.format.DateFormat.getTimeFormatString(context); in getDateTimeStringFromMs()
222 DateFormat fmt = DateFormat.getInstanceForSkeleton(skeleton); in getDateTimeStringFromMs()
235 String skeleton = android.text.format.DateFormat.getTimeFormatString(context); in getRegularTimeRemainingShortString()
236 DateFormat fmt = DateFormat.getInstanceForSkeleton(skeleton); in getRegularTimeRemainingShortString()
/aosp12/frameworks/base/core/java/android/service/autofill/
H A DDateValueSanitizer.java24 import android.icu.text.DateFormat;
47 private final DateFormat mDateFormat;
54 public DateValueSanitizer(@NonNull DateFormat dateFormat) { in DateValueSanitizer()
115 return new DateValueSanitizer((DateFormat) parcel.readSerializable());
H A DDateTransformation.java23 import android.icu.text.DateFormat;
51 private final DateFormat mDateFormat;
59 public DateTransformation(@NonNull AutofillId id, @NonNull DateFormat dateFormat) { in DateTransformation()
119 (DateFormat) parcel.readSerializable());
/aosp12/packages/apps/TV/src/com/android/tv/ui/
H A DLocaleAwareTextClock.java20 import android.text.format.DateFormat;
39 String pattern12 = DateFormat.getBestDateTimePattern(getTextLocale(), "hm MMMd"); in LocaleAwareTextClock()
40 String pattern24 = DateFormat.getBestDateTimePattern(getTextLocale(), "Hm MMMd"); in LocaleAwareTextClock()
/aosp12/frameworks/base/packages/SystemUI/src/com/android/keyguard/
H A DAnimatableClockView.java25 import android.text.format.DateFormat;
137 setText(DateFormat.format(mFormat, mTime)); in refreshTime()
138 setContentDescription(DateFormat.format(mDescFormat, mTime)); in refreshTime()
271 final boolean use24HourFormat = DateFormat.is24HourFormat(getContext()); in refreshFormat()
300 sClockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel); in update()
307 sClockView24 = DateFormat.getBestDateTimePattern(locale, clockView24Skel); in update()
/aosp12/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/datetime/
H A DTimePickerFragmentTest.java24 import android.text.format.DateFormat;
61 mSession = ExtendedMockito.mockitoSession().spyStatic(DateFormat.class).startMocking(); in setUp()
74 ExtendedMockito.doReturn(false).when(() -> DateFormat.is24HourFormat(any())); in onActivityCreated_isNot24HourFormat_timePickerShouldShow12HourTimeFormat()
84 ExtendedMockito.doReturn(true).when(() -> DateFormat.is24HourFormat(any())); in onActivityCreated_is24HourFormat_timePickerShouldShow24HourTimeFormat()
/aosp12/packages/apps/Settings/src/com/android/settings/display/darkmode/
H A DTimeFormatter.java29 private final java.text.DateFormat mFormatter;
32 mFormatter = android.text.format.DateFormat.getTimeFormat(context); in TimeFormatter()
47 return android.text.format.DateFormat.is24HourFormat(mContext); in is24HourFormat()
/aosp12/packages/apps/Settings/src/com/android/settings/datetime/timezone/
H A DBaseTimeZoneInfoPicker.java23 import android.icu.text.DateFormat;
87 final DateFormat currentTimeFormat = new SimpleDateFormat( in createTimeZoneInfoItems()
88 android.text.format.DateFormat.getTimeFormatString(context), locale); in createTimeZoneInfoItems()
103 private final DateFormat mTimeFormat;
108 DateFormat timeFormat) { in TimeZoneInfoItem()
/aosp12/frameworks/base/tests/HwAccelerationTest/src/com/android/test/hwui/
H A DDatePicker.java24 import android.text.format.DateFormat;
206 java.text.DateFormat format; in reorderPickers()
217 format = DateFormat.getDateFormat(getContext()); in reorderPickers()
219 format = DateFormat.getMediumDateFormat(getContext()); in reorderPickers()
226 order = new String(DateFormat.getDateFormatOrder(getContext())); in reorderPickers()
246 if (c == DateFormat.DATE && !didDay) { in reorderPickers()
249 } else if ((c == DateFormat.MONTH || c == 'L') && !didMonth) { in reorderPickers()
252 } else if (c == DateFormat.YEAR && !didYear) { in reorderPickers()
/aosp12/packages/apps/Settings/src/com/android/settings/notification/zen/
H A DZenModeVoiceActivity.java31 import android.text.format.DateFormat;
111 String skeleton = DateFormat.is24HourFormat(this, UserHandle.myUserId()) ? "Hm" : "hma"; in getChangeSummary()
112 String pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton); in getChangeSummary()
113 CharSequence formattedTime = DateFormat.format(pattern, time); in getChangeSummary()

12345678