mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Remove AndroidDateFormats
This commit is contained in:
@@ -459,9 +459,9 @@ public class BarChart extends ScrollableChart
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dfYear = AndroidDateFormats.fromSkeleton("yyyy");
|
dfYear = DateExtensionsKt.toSimpleDataFormat("yyyy");
|
||||||
dfMonth = AndroidDateFormats.fromSkeleton("MMM");
|
dfMonth = DateExtensionsKt.toSimpleDataFormat("MMM");
|
||||||
dfDay = AndroidDateFormats.fromSkeleton("d");
|
dfDay = DateExtensionsKt.toSimpleDataFormat("d");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initPaints()
|
private void initPaints()
|
||||||
|
|||||||
@@ -316,8 +316,8 @@ public class FrequencyChart extends ScrollableChart
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dfMonth = AndroidDateFormats.fromSkeleton("MMM");
|
dfMonth = DateExtensionsKt.toSimpleDataFormat("MMM");
|
||||||
dfYear = AndroidDateFormats.fromSkeleton("yyyy");
|
dfYear = DateExtensionsKt.toSimpleDataFormat("yyyy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -509,8 +509,8 @@ public class HistoryChart extends ScrollableChart
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dfMonth = AndroidDateFormats.fromSkeleton("MMM");
|
dfMonth = DateExtensionsKt.toSimpleDataFormat("MMM");
|
||||||
dfYear = AndroidDateFormats.fromSkeleton("yyyy");
|
dfYear = DateExtensionsKt.toSimpleDataFormat("yyyy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -421,9 +421,9 @@ public class ScoreChart extends ScrollableChart
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dfMonth = AndroidDateFormats.fromSkeleton("MMM");
|
dfMonth = DateExtensionsKt.toSimpleDataFormat("MMM");
|
||||||
dfYear = AndroidDateFormats.fromSkeleton("yyyy");
|
dfYear = DateExtensionsKt.toSimpleDataFormat("yyyy");
|
||||||
dfDay = AndroidDateFormats.fromSkeleton("d");
|
dfDay = DateExtensionsKt.toSimpleDataFormat("d");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017 Álinson Santos Xavier <isoron@gmail.com>
|
* Copyright (C) 2016-2020 Álinson Santos Xavier <isoron@gmail.com>
|
||||||
*
|
*
|
||||||
* This file is part of Loop Habit Tracker.
|
* This file is part of Loop Habit Tracker.
|
||||||
*
|
*
|
||||||
@@ -16,24 +16,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License along
|
* You should have received a copy of the GNU General Public License along
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.isoron.uhabits.utils;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
package org.isoron.uhabits.utils
|
||||||
|
|
||||||
import org.isoron.uhabits.core.utils.*;
|
import android.text.format.DateFormat
|
||||||
|
import org.isoron.uhabits.core.utils.*
|
||||||
|
import java.text.*
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
import java.text.*;
|
fun String.toSimpleDataFormat(): SimpleDateFormat {
|
||||||
import java.util.*;
|
val locale = Locale.getDefault()
|
||||||
|
return DateFormats.fromSkeleton(DateFormat.getBestDateTimePattern(locale, this), locale)
|
||||||
import static android.text.format.DateFormat.getBestDateTimePattern;
|
|
||||||
|
|
||||||
public class AndroidDateFormats
|
|
||||||
{
|
|
||||||
@NonNull
|
|
||||||
public static SimpleDateFormat fromSkeleton(@NonNull String skeleton)
|
|
||||||
{
|
|
||||||
Locale locale = Locale.getDefault();
|
|
||||||
skeleton = getBestDateTimePattern(locale, skeleton);
|
|
||||||
return DateFormats.fromSkeleton(skeleton, locale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user