use of android.icu.text.DateFormat in project android_frameworks_base by ResurrectionRemix.
the class DateView method updateClock.
protected void updateClock() {
if (mDateFormat == null) {
final Locale l = Locale.getDefault();
DateFormat format = DateFormat.getInstanceForSkeleton(mDatePattern, l);
format.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mDateFormat = format;
}
mCurrentTime.setTime(System.currentTimeMillis());
final String text = getDateFormat();
if (!text.equals(mLastText)) {
setText(text);
mLastText = text;
}
}
use of android.icu.text.DateFormat in project platform_frameworks_base by android.
the class DateView method updateClock.
protected void updateClock() {
if (mDateFormat == null) {
final Locale l = Locale.getDefault();
DateFormat format = DateFormat.getInstanceForSkeleton(mDatePattern, l);
format.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mDateFormat = format;
}
mCurrentTime.setTime(System.currentTimeMillis());
final String text = mDateFormat.format(mCurrentTime);
if (!text.equals(mLastText)) {
setText(text);
mLastText = text;
}
}
use of android.icu.text.DateFormat in project android_frameworks_base by crdroidandroid.
the class DateView method updateClock.
protected void updateClock() {
if (mDateFormat == null) {
final Locale l = Locale.getDefault();
DateFormat format = DateFormat.getInstanceForSkeleton(mDatePattern, l);
format.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mDateFormat = format;
}
mCurrentTime.setTime(System.currentTimeMillis());
final String text = getDateFormat();
if (!text.equals(mLastText)) {
setText(text);
mLastText = text;
}
}
use of android.icu.text.DateFormat in project android_frameworks_base by AOSPA.
the class DateView method updateClock.
protected void updateClock() {
if (mDateFormat == null) {
final Locale l = Locale.getDefault();
DateFormat format = DateFormat.getInstanceForSkeleton(mDatePattern, l);
format.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mDateFormat = format;
}
mCurrentTime.setTime(System.currentTimeMillis());
final String text = getDateFormat();
if (!text.equals(mLastText)) {
setText(text);
mLastText = text;
}
}
use of android.icu.text.DateFormat in project robolectric by robolectric.
the class ShadowDateIntervalFormatTest method testDateInterval_FormatDateRange.
@Test
public void testDateInterval_FormatDateRange() throws ParseException {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, 2013);
calendar.set(Calendar.MONTH, Calendar.JANUARY);
calendar.set(Calendar.DAY_OF_MONTH, 20);
long timeInMillis = calendar.getTimeInMillis();
String actual = DateIntervalFormat.formatDateRange(ULocale.getDefault(), TimeZone.getDefault(), timeInMillis, timeInMillis, DateUtils.FORMAT_NUMERIC_DATE);
DateFormat format = new SimpleDateFormat("MM/dd/yyyy", ULocale.getDefault());
Date date = format.parse(actual);
assertThat(date).isNotNull();
}
Aggregations