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
     }
62
     }
63
   ],
63
   ],
64
   "regular_programme" : "Programmation habituelle",
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
 import java.net.URL
12
 import java.net.URL
13
 import java.text.ParseException
13
 import java.text.ParseException
14
 import java.text.SimpleDateFormat
14
 import java.text.SimpleDateFormat
15
+import java.time.format.TextStyle
15
 import java.util.*
16
 import java.util.*
16
 import kotlin.collections.ArrayList
17
 import kotlin.collections.ArrayList
17
 
18
 
61
     {
62
     {
62
         val dateFormat = SimpleDateFormat("yyyy-MM-dd hh:mm:ss z", Locale.getDefault())
63
         val dateFormat = SimpleDateFormat("yyyy-MM-dd hh:mm:ss z", Locale.getDefault())
63
         try {
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
             //[REMOVE LOG CALLS]Log.d(tag, "date: $s -> $t")
66
             //[REMOVE LOG CALLS]Log.d(tag, "date: $s -> $t")
66
             return t!!.time
67
             return t!!.time
67
         } catch (e: ParseException) {
68
         } catch (e: ParseException) {

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

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