Skip to content

Commit

Permalink
Recorder: Use medium localized datetime for filename
Browse files Browse the repository at this point in the history
Change-Id: I10b0c4a4bdde87a5113c9efede4f75e5c27a06cf
  • Loading branch information
luca020400 committed Sep 9, 2024
1 parent 330f45c commit ff23879
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/src/main/java/org/lineageos/recorder/RecorderActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import org.lineageos.recorder.utils.Utils
import org.lineageos.recorder.viewmodels.RecordingsViewModel
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder
import java.time.format.FormatStyle
import java.time.temporal.ChronoUnit
import java.util.Locale
import kotlin.reflect.safeCast
Expand Down Expand Up @@ -373,11 +373,9 @@ class RecorderActivity : AppCompatActivity(R.layout.activity_main) {
private val newRecordFileName: String
get() {
val tag = locationHelper.currentLocationName ?: FILE_NAME_FALLBACK
val formatter = DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral(' ')
.append(DateTimeFormatter.ISO_LOCAL_TIME)
.toFormatter(Locale.getDefault())
val formatter = DateTimeFormatter
.ofLocalizedDateTime(FormatStyle.MEDIUM)
.withLocale(Locale.getDefault())
val now = LocalDateTime.now()
return String.format(
FILE_NAME_BASE, tag,
Expand Down

0 comments on commit ff23879

Please sign in to comment.