Home
last modified time | relevance | path

Searched refs:DateUtils (Results 1 – 25 of 189) sorted by relevance

12345678

/packages/apps/Calendar/tests/src/com/android/calendar/
DFormatDateRangeTest.java21 import android.text.format.DateUtils;
41 if ((flags & DateUtils.FORMAT_UTC) != 0) { in DateTest()
76 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL, "8 \u2013 11 AM"),
78 DateUtils.FORMAT_SHOW_TIME, "8:00 \u2013 11:00 AM"),
80 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_24HOUR, "08:00 \u2013 17:00"),
82 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL, "8 AM \u2013 12 PM"),
84DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_NO_NOON | DateUtils.FORMAT_ABBREV_ALL,
87DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_CAP_NOON | DateUtils.FORMAT_ABBREV_ALL,
90DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL, "10:30 AM \u2013 1:00 PM"),
92 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL, "1 \u2013 2 PM"),
[all …]
DWeekNumberTest.java22 import android.text.format.DateUtils;
212 int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE; in testAll()
213 String output = DateUtils.formatDateTime(mContext, millis, flags); in testAll()
224 int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE; in testAll()
225 String output = DateUtils.formatDateTime(mContext, millis, flags); in testAll()
/packages/apps/Messaging/src/com/android/messaging/util/
DDates.java20 import android.text.format.DateUtils;
45 @VisibleForTesting public static final int FORCE_12_HOUR = DateUtils.FORMAT_12HOUR;
47 @VisibleForTesting public static final int FORCE_24_HOUR = DateUtils.FORMAT_24HOUR;
67 if (now - time < DateUtils.MINUTE_IN_MILLIS) { in getRelativeTimeSpanString()
77 return DateUtils.getRelativeTimeSpanString(time, now, DateUtils.MINUTE_IN_MILLIS, in getRelativeTimeSpanString()
78 DateUtils.FORMAT_ABBREV_RELATIVE).toString(); in getRelativeTimeSpanString()
132 if (!minPeriodToday && timeDiff < DateUtils.MINUTE_IN_MILLIS) { in getTimestamp()
134 } else if (!minPeriodToday && timeDiff < DateUtils.HOUR_IN_MILLIS) { in getTimestamp()
138 } else if (timeDiff < DateUtils.WEEK_IN_MILLIS) { in getTimestamp()
140 } else if (timeDiff < DateUtils.YEAR_IN_MILLIS) { in getTimestamp()
[all …]
/packages/apps/TV/tests/robotests/src/com/android/tv/util/
DUtilsTest.java22 import android.text.format.DateUtils;
102 DateUtils.FORMAT_12HOUR)); in testSameDateAndTime()
111 DateUtils.FORMAT_24HOUR)); in testSameDateAndTime()
124 DateUtils.FORMAT_12HOUR)); in testDurationWithinToday()
133 DateUtils.FORMAT_24HOUR)); in testDurationWithinToday()
146 DateUtils.FORMAT_12HOUR)); in testDurationFromYesterdayToToday()
155 DateUtils.FORMAT_24HOUR)); in testDurationFromYesterdayToToday()
164 DateUtils.FORMAT_12HOUR)); in testDurationFromYesterdayToToday()
173 DateUtils.FORMAT_24HOUR)); in testDurationFromYesterdayToToday()
186 DateUtils.FORMAT_12HOUR)); in testDurationFromTodayToTomorrow()
[all …]
/packages/apps/Dialer/java/com/android/dialer/calllogutils/
DCallLogDates.java22 import android.text.format.DateUtils;
57 ? DateUtils.getRelativeTimeSpanString( in newCallLogTimestampLabel()
60 DateUtils.MINUTE_IN_MILLIS, in newCallLogTimestampLabel()
61 DateUtils.FORMAT_ABBREV_RELATIVE) in newCallLogTimestampLabel()
67 : DateUtils.getRelativeTimeSpanString( in newCallLogTimestampLabel()
68 timestampMillis, nowMillis, DateUtils.MINUTE_IN_MILLIS); in newCallLogTimestampLabel()
75 return DateUtils.formatDateTime(context, timestampMillis, DateUtils.FORMAT_SHOW_TIME); in newCallLogTimestampLabel()
105 DateUtils.formatDateTime( in formatDate()
108 DateUtils.FORMAT_SHOW_TIME in formatDate()
109 | DateUtils.FORMAT_SHOW_DATE in formatDate()
[all …]
/packages/apps/Calendar/src/com/android/calendar/
DCalendarViewAdapter.java23 import android.text.format.DateUtils;
308 DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, in buildDayOfWeek()
309 DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString()); in buildDayOfWeek()
312 DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, in buildDayOfWeek()
313 DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString()); in buildDayOfWeek()
316 DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, in buildDayOfWeek()
317 DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString()); in buildDayOfWeek()
319 dayOfWeek = DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, in buildDayOfWeek()
320 DateUtils.FORMAT_SHOW_WEEKDAY, mTimeZone).toString(); in buildDayOfWeek()
333 String date = DateUtils.formatDateRange(mContext, mFormatter, mMilliTime, mMilliTime, in buildFullDate()
[all …]
/packages/apps/DocumentsUI/src/com/android/documentsui/util/
DFormatUtils.java23 import android.text.format.DateUtils;
46 if (millis >= DateUtils.HOUR_IN_MILLIS) { in formatDuration()
48 (int) ((millis + DateUtils.HOUR_IN_MILLIS / 2) / DateUtils.HOUR_IN_MILLIS); in formatDuration()
50 } else if (millis >= DateUtils.MINUTE_IN_MILLIS) { in formatDuration()
52 (int) ((millis + DateUtils.MINUTE_IN_MILLIS / 2) / DateUtils.MINUTE_IN_MILLIS); in formatDuration()
56 (int) ((millis + DateUtils.SECOND_IN_MILLIS / 2) / DateUtils.SECOND_IN_MILLIS); in formatDuration()
/packages/apps/DeskClock/src/com/android/deskclock/
DStopwatchTextController.kt19 import android.text.format.DateUtils
40 val hours = (accumulatedTime / DateUtils.HOUR_IN_MILLIS).toInt() in setTimeString()
41 var remainder = (accumulatedTime % DateUtils.HOUR_IN_MILLIS).toInt() in setTimeString()
43 val minutes = (remainder / DateUtils.MINUTE_IN_MILLIS).toInt() in setTimeString()
44 remainder = (remainder % DateUtils.MINUTE_IN_MILLIS).toInt() in setTimeString()
46 val seconds = (remainder / DateUtils.SECOND_IN_MILLIS).toInt() in setTimeString()
47 remainder = (remainder % DateUtils.SECOND_IN_MILLIS).toInt() in setTimeString()
53 if (mLastTime / DateUtils.SECOND_IN_MILLIS != in setTimeString()
54 accumulatedTime / DateUtils.SECOND_IN_MILLIS) { in setTimeString()
DTimerTextController.kt19 import android.text.format.DateUtils
34 var hours = (variableRemainingTime / DateUtils.HOUR_IN_MILLIS).toInt() in setTimeString()
35 var remainder = (variableRemainingTime % DateUtils.HOUR_IN_MILLIS).toInt() in setTimeString()
37 var minutes = (remainder / DateUtils.MINUTE_IN_MILLIS).toInt() in setTimeString()
38 remainder = (remainder % DateUtils.MINUTE_IN_MILLIS).toInt() in setTimeString()
40 var seconds = (remainder / DateUtils.SECOND_IN_MILLIS).toInt() in setTimeString()
41 remainder = (remainder % DateUtils.SECOND_IN_MILLIS).toInt() in setTimeString()
/packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
DCellBroadcastListItem.java26 import android.text.format.DateUtils;
70 mDateView.setText(DateUtils.formatDateTime(getContext(), message.getReceivedTime(), in bind()
71 DateUtils.FORMAT_NO_NOON_MIDNIGHT | DateUtils.FORMAT_SHOW_TIME in bind()
72 | DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE in bind()
73 | DateUtils.FORMAT_CAP_AMPM)); in bind()
100 int flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE; in dispatchPopulateAccessibilityEvent()
101 String dateTime = DateUtils.formatDateTime(getContext(), mCbMessage.getReceivedTime(), in dispatchPopulateAccessibilityEvent()
/packages/apps/Gallery2/src/com/android/gallery3d/data/
DTimeClustering.java21 import android.text.format.DateUtils;
404 caption = DateUtils.formatDateRange(context, minTimestamp, in generateCaption()
405 maxTimestamp, DateUtils.FORMAT_ABBREV_ALL); in generateCaption()
411 int flags = DateUtils.FORMAT_ABBREV_MONTH | DateUtils.FORMAT_SHOW_DATE; in generateCaption()
414 String dateRangeWithOptionalYear = DateUtils.formatDateTime( in generateCaption()
416 String dateRangeWithYear = DateUtils.formatDateTime( in generateCaption()
417 context, minTimestamp, flags | DateUtils.FORMAT_SHOW_YEAR); in generateCaption()
424 caption = DateUtils.formatDateRange(context, midTimestamp, in generateCaption()
425 midTimestamp, DateUtils.FORMAT_SHOW_TIME | flags); in generateCaption()
431 int flags = DateUtils.FORMAT_NO_MONTH_DAY in generateCaption()
[all …]
/packages/apps/Calendar/tests/src/com/android/calendar/widget/
DCalendarAppWidgetServiceTest.java29 import android.text.format.DateUtils;
115 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL); in testGetAppWidgetModel_1Event()
142 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL); in testGetAppWidgetModel_AllDayEventLater()
163 eventInfo.when = DateUtils.formatDateTime(context, end, in testGetAppWidgetModel_AllDayEventLater()
164 DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL); in testGetAppWidgetModel_AllDayEventLater()
/packages/apps/DocumentsUI/src/com/android/documentsui/base/
DShared.java39 import android.text.format.DateUtils;
198 int flags = DateUtils.FORMAT_NO_NOON | DateUtils.FORMAT_NO_MIDNIGHT in formatTime()
199 | DateUtils.FORMAT_ABBREV_ALL; in formatTime()
202 flags |= DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_SHOW_DATE; in formatTime()
204 flags |= DateUtils.FORMAT_SHOW_DATE; in formatTime()
206 flags |= DateUtils.FORMAT_SHOW_TIME; in formatTime()
209 return DateUtils.formatDateTime(context, when, flags); in formatTime()
/packages/apps/DeskClock/src/com/android/deskclock/stopwatch/
DLapsAdapter.kt20 import android.text.format.DateUtils
283 private val TEN_MINUTES: Long = 10 * DateUtils.MINUTE_IN_MILLIS
284 private val HOUR: Long = DateUtils.HOUR_IN_MILLIS
313 hours = (time / DateUtils.HOUR_IN_MILLIS).toInt() in formatTime()
314 var remainder = (time % DateUtils.HOUR_IN_MILLIS).toInt() in formatTime()
315 minutes = (remainder / DateUtils.MINUTE_IN_MILLIS).toInt() in formatTime()
316 remainder = (remainder % DateUtils.MINUTE_IN_MILLIS).toInt() in formatTime()
317 seconds = (remainder / DateUtils.SECOND_IN_MILLIS).toInt() in formatTime()
318 remainder = (remainder % DateUtils.SECOND_IN_MILLIS).toInt() in formatTime()
/packages/providers/CalendarProvider/src/com/android/providers/calendar/
DCalendarAlarmManager.java41 import android.text.format.DateUtils;
92 private static final long SCHEDULE_ALARM_SLACK = 2 * DateUtils.HOUR_IN_MILLIS;
102 private static final long CLEAR_OLD_ALARM_THRESHOLD = 7 * DateUtils.DAY_IN_MILLIS
110 static final long NEXT_ALARM_CHECK_TIME_MS = DateUtils.DAY_IN_MILLIS -
111 (15 * DateUtils.MINUTE_IN_MILLIS);
258 final long end = currentMillis + DateUtils.DAY_IN_MILLIS; in scheduleNextAlarmLocked()
315 String subQuerySuffix = " -(" + Reminders.MINUTES + "*" + +DateUtils.MINUTE_IN_MILLIS + ")" in scheduleNextAlarmLocked()
355 start - DateUtils.DAY_IN_MILLIS, end + DateUtils.DAY_IN_MILLIS, false /* in scheduleNextAlarmLocked()
408 } else if (alarmTime > nextAlarmTime + DateUtils.MINUTE_IN_MILLIS) { in scheduleNextAlarmLocked()
/packages/apps/DeskClock/src/com/android/deskclock/uidata/
DPeriodicCallbackModel.kt25 import android.text.format.DateUtils
161 private const val QUARTER_HOUR_IN_MILLIS = 15 * DateUtils.MINUTE_IN_MILLIS
181 val lastMinute = periodStart - periodStart % DateUtils.MINUTE_IN_MILLIS in getDelay()
182 val nextMinute = lastMinute + DateUtils.MINUTE_IN_MILLIS in getDelay()
191 val lastHour = periodStart - periodStart % DateUtils.HOUR_IN_MILLIS in getDelay()
192 val nextHour = lastHour + DateUtils.HOUR_IN_MILLIS in getDelay()
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/
DCalendarConfidenceCheckerTest.java23 import android.text.format.DateUtils;
98 mInjectedRealtimeMillis += DateUtils.DAY_IN_MILLIS - (15 * DateUtils.MINUTE_IN_MILLIS); in testWithLastCheckTime()
112 mInjectedRealtimeMillis += DateUtils.DAY_IN_MILLIS - (15 * DateUtils.MINUTE_IN_MILLIS); in testWithLastCheckTime()
/packages/apps/Dialer/java/com/android/dialer/app/calllog/
DPhoneCallDetailsHelper.java34 import android.text.format.DateUtils;
517 return DateUtils.getRelativeTimeSpanString( in getCallDate()
520 DateUtils.MINUTE_IN_MILLIS, in getCallDate()
521 DateUtils.FORMAT_ABBREV_RELATIVE); in getCallDate()
540 DateUtils.formatDateTime(context, details.date, DateUtils.FORMAT_SHOW_TIME)); in getGranularDateTime()
547 if (DateUtils.isToday(date)) { in getGranularDate()
550 return DateUtils.formatDateTime( in getGranularDate()
553 DateUtils.FORMAT_SHOW_DATE in getGranularDate()
554 | DateUtils.FORMAT_ABBREV_MONTH in getGranularDate()
555 | (shouldShowYear(date) ? DateUtils.FORMAT_SHOW_YEAR : DateUtils.FORMAT_NO_YEAR)); in getGranularDate()
/packages/apps/Car/Dialer/src/com/android/car/dialer/ui/common/
DUiCallLogLiveData.java20 import android.text.format.DateUtils;
157 return validTimestamp ? DateUtils.getRelativeTimeSpanString( in getRelativeTime()
158 millis, System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS, in getRelativeTime()
159 DateUtils.FORMAT_ABBREV_RELATIVE).toString() : ""; in getRelativeTime()
165 if (DateUtils.isToday(calllogTime)) { in getHeader()
173 if (DateUtils.isToday(callLogCalender.getTimeInMillis())) { in getHeader()
/packages/apps/Calendar/src/com/android/calendar/widget/
DCalendarAppWidgetModel.java26 import android.text.format.DateUtils;
361 int flags = DateUtils.FORMAT_ABBREV_ALL; in populateEventInfo()
364 flags |= DateUtils.FORMAT_SHOW_DATE; in populateEventInfo()
367 flags |= DateUtils.FORMAT_SHOW_TIME; in populateEventInfo()
369 flags |= DateUtils.FORMAT_24HOUR; in populateEventInfo()
372 flags |= DateUtils.FORMAT_SHOW_DATE; in populateEventInfo()
409 int flags = DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE; in populateDayInfo()
416 flags |= DateUtils.FORMAT_SHOW_WEEKDAY; in populateDayInfo()
/packages/apps/Car/Settings/src/com/android/car/settings/datausage/
DDataUsageUtils.java26 import android.text.format.DateUtils;
93 int flags = DateUtils.FORMAT_ABBREV_MONTH | DateUtils.FORMAT_NO_YEAR; in formatDataUsageInCycle()
94 String fromText = DateUtils.formatDateTime(context, fromTimeInMillis, flags); in formatDataUsageInCycle()
95 String toText = DateUtils.formatDateTime(context, Calendar.getInstance().getTimeInMillis(), in formatDataUsageInCycle()
/packages/apps/Dialer/java/com/android/dialer/rtt/
DRttTranscriptMessageViewHolder.java22 import android.text.format.DateUtils;
88 return DateUtils.formatDateTime( in getTimestampText()
92 ? DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME in getTimestampText()
93 : DateUtils.FORMAT_SHOW_TIME); in getTimestampText()
/packages/apps/Contacts/src/com/android/contacts/editor/
DEventFieldEditorView.java39 import com.android.contacts.util.DateUtils;
123 String data = DateUtils.formatDate(getContext(), getEntry().getAsString(column), in rebuildDateView()
166 final Calendar calendar = Calendar.getInstance(DateUtils.UTC_TIMEZONE, Locale.US); in onLabelRebuilt()
202 final Calendar calendar = Calendar.getInstance(DateUtils.UTC_TIMEZONE, Locale.US); in createDatePickerDialog()
217 Calendar cal = DateUtils.parseDate(oldValue, false); in createDatePickerDialog()
219 if (DateUtils.isYearSet(cal)) { in createDatePickerDialog()
236 Calendar.getInstance(DateUtils.UTC_TIMEZONE, Locale.US); in createDatePickerDialog()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/enterprise/
DAdminActionPreferenceControllerBase.java20 import android.text.format.DateUtils;
51 : DateUtils.formatDateTime(mContext, timestamp.getTime(), in updateState()
52 DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE)); in updateState()
/packages/apps/Car/Calendar/src/com/android/car/calendar/common/
DCalendarFormatter.java19 import static android.text.format.DateUtils.FORMAT_ABBREV_ALL;
20 import static android.text.format.DateUtils.FORMAT_NO_YEAR;
21 import static android.text.format.DateUtils.FORMAT_SHOW_TIME;
27 import android.text.format.DateUtils;
106 return DateUtils.formatDateRange( in getTimeRangeText()

12345678