Skip to content

Commit ee1009a

Browse files
authored
Don't suppress SimpleDateFormat lint in BackupUtils (#2372)
Just use `Locale.getDefault()` like we do everywhere else in the app.
1 parent dd3be24 commit ee1009a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/src/main/java/com/lagradost/cloudstream3/utils/BackupUtils.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.lagradost.cloudstream3.utils
22

3-
import android.annotation.SuppressLint
43
import android.content.Context
54
import android.net.Uri
65
import android.widget.Toast
@@ -40,6 +39,7 @@ import java.io.PrintWriter
4039
import java.lang.System.currentTimeMillis
4140
import java.text.SimpleDateFormat
4241
import java.util.Date
42+
import java.util.Locale
4343

4444
object BackupUtils {
4545

@@ -164,7 +164,6 @@ object BackupUtils {
164164
}
165165
}
166166

167-
@SuppressLint("SimpleDateFormat")
168167
fun backup(context: Context?) = ioSafe {
169168
if (context == null) return@ioSafe
170169

@@ -177,7 +176,7 @@ object BackupUtils {
177176
return@ioSafe
178177
}
179178

180-
val date = SimpleDateFormat("yyyy_MM_dd_HH_mm").format(Date(currentTimeMillis()))
179+
val date = SimpleDateFormat("yyyy_MM_dd_HH_mm", Locale.getDefault()).format(Date(currentTimeMillis()))
181180
val displayName = "CS3_Backup_${date}"
182181
val backupFile = getBackup(context)
183182
val stream = setupBackupStream(context, displayName)

0 commit comments

Comments
 (0)