Browse Source

fixed DST for Paris

yattoz 4 years ago
parent
commit
c8abee4e97

+ 1 - 1
app/src/main/assets/planning_example.json View File

@@ -62,5 +62,5 @@
62 62
     }
63 63
   ],
64 64
   "regular_programme" : "Programmation habituelle",
65
-  "timezone": "GMT+1"
65
+  "timezone": "Europe/Paris"
66 66
 }

+ 2 - 1
app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt View File

@@ -12,6 +12,7 @@ import org.json.JSONObject
12 12
 import java.net.URL
13 13
 import java.text.ParseException
14 14
 import java.text.SimpleDateFormat
15
+import java.time.format.TextStyle
15 16
 import java.util.*
16 17
 import kotlin.collections.ArrayList
17 18
 
@@ -61,7 +62,7 @@ class PlayerStore {
61 62
     {
62 63
         val dateFormat = SimpleDateFormat("yyyy-MM-dd hh:mm:ss z", Locale.getDefault())
63 64
         try {
64
-            val t: Date? = dateFormat.parse("$s ${Planning.instance.timeZone.id}")
65
+            val t: Date? = dateFormat.parse("$s ${Planning.instance.timeZone.getDisplayName(Planning.instance.timeZone.useDaylightTime(), TimeZone.SHORT)}")
65 66
             //[REMOVE LOG CALLS]Log.d(tag, "date: $s -> $t")
66 67
             return t!!.time
67 68
         } catch (e: ParseException) {

+ 4 - 4
app/src/main/java/fr/forum_thalie/tsumugi/ui/programme/ProgrammeAdapter.kt View File

@@ -1,18 +1,18 @@
1 1
 package fr.forum_thalie.tsumugi.ui.programme
2 2
 
3 3
 import android.annotation.SuppressLint
4
-import android.util.TypedValue
5 4
 import android.view.LayoutInflater
6 5
 import android.view.ViewGroup
7 6
 import android.widget.TextView
8 7
 import androidx.constraintlayout.widget.ConstraintLayout
9
-import androidx.core.widget.TextViewCompat
10 8
 import androidx.recyclerview.widget.RecyclerView
11
-import fr.forum_thalie.tsumugi.*
9
+import fr.forum_thalie.tsumugi.R
10
+import fr.forum_thalie.tsumugi.colorAccent
11
+import fr.forum_thalie.tsumugi.colorWhited
12 12
 import fr.forum_thalie.tsumugi.planning.Planning
13 13
 import fr.forum_thalie.tsumugi.planning.Programme
14
+import fr.forum_thalie.tsumugi.weekdaysSundayFirst
14 15
 import java.util.*
15
-import kotlin.collections.ArrayList
16 16
 
17 17
 class ProgrammeAdapter(private val dataSet: ArrayList<Programme>, private val day: String
18 18
     /*,