date format based on the app locale #744

This commit is contained in:
PranshulGG committed 2026-08-16 12:55:49 +05:30
1 parent d5a2b30ce2
commit b35e1eb202
1 file changed
+8 -1
@@ -1,5 +1,6 @@
package com.pranshulgg.weather_master_app.feature.daily.ui
import android.text.format.DateFormat.getBestDateTimePattern
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
@@ -20,6 +21,7 @@ import com.pranshulgg.weather_master_app.core.model.weather.toLabel
import com.pranshulgg.weather_master_app.core.ui.components.Gap
import com.pranshulgg.weather_master_app.core.ui.components.WeatherIconBox
import com.pranshulgg.weather_master_app.core.utils.formatters.toDateString
import com.pranshulgg.weather_master_app.core.utils.locale.getCurrentAppLocale
import kotlin.math.roundToInt
@@ -30,7 +32,12 @@ fun DailyForecastHeroHeader(
units: WeatherUnits
) {
val date = toDateString(daily.time, location.timezone)
val date = toDateString(
daily.time, location.timezone, getBestDateTimePattern(
getCurrentAppLocale(),
"MMMMdd"
)
)
val context = LocalContext.current
val maxTemp =