Compare commits
20 commits
dependabot
...
2.6.15
Author | SHA1 | Date | |
---|---|---|---|
![]() |
386ae58817 | ||
![]() |
dd3d62c10d | ||
![]() |
05c6c8bc96 | ||
![]() |
1f0b400e5a | ||
![]() |
718bbea329 | ||
![]() |
8390ccad20 | ||
![]() |
bf9f048116 | ||
![]() |
56bfabdf11 | ||
![]() |
6e2bcfbe02 | ||
![]() |
440cc7ae89 | ||
![]() |
51dd343299 | ||
![]() |
5ee7fee09d | ||
![]() |
ff56348586 | ||
![]() |
a69361708e | ||
![]() |
3cbe98d7b8 | ||
![]() |
503a97bc4c | ||
![]() |
ae6a35121b | ||
![]() |
558addd097 | ||
![]() |
e8f9c57c34 | ||
![]() |
4d67de8e5f |
13 changed files with 549 additions and 577 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -71,7 +71,6 @@ captures/
|
|||
.idea/deploymentTargetDropDown.xml
|
||||
.idea/deploymentTargetSelector.xml
|
||||
.idea/kotlinc.xml
|
||||
.idea/studiobot.xml
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
|
|
|
@ -256,7 +256,7 @@ dependencies {
|
|||
playImplementation 'com.google.firebase:firebase-crashlytics:'
|
||||
playImplementation 'com.google.firebase:firebase-config'
|
||||
|
||||
playImplementation 'com.google.android.gms:play-services-ads:22.6.0'
|
||||
playImplementation 'com.google.android.gms:play-services-ads:23.1.0'
|
||||
playImplementation "com.google.android.play:integrity:1.3.0"
|
||||
playImplementation 'com.google.android.play:app-update-ktx:2.1.0'
|
||||
playImplementation 'com.google.android.play:review-ktx:2.0.1'
|
||||
|
|
|
@ -1,32 +1,14 @@
|
|||
package io.github.wulkanowy.utils
|
||||
|
||||
import java.text.SimpleDateFormat
|
||||
import java.time.DayOfWeek.FRIDAY
|
||||
import java.time.DayOfWeek.MONDAY
|
||||
import java.time.DayOfWeek.SATURDAY
|
||||
import java.time.DayOfWeek.SUNDAY
|
||||
import java.time.Instant
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
import java.time.Month
|
||||
import java.time.ZoneId
|
||||
import java.time.ZoneOffset
|
||||
import java.time.*
|
||||
import java.time.DayOfWeek.*
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.temporal.TemporalAdjusters.firstInMonth
|
||||
import java.time.temporal.TemporalAdjusters.next
|
||||
import java.time.temporal.TemporalAdjusters.previous
|
||||
import java.util.Locale
|
||||
import java.time.temporal.TemporalAdjusters.*
|
||||
import java.util.*
|
||||
|
||||
private const val DEFAULT_DATE_PATTERN = "dd.MM.yyyy"
|
||||
|
||||
fun getDefaultLocaleWithFallback(): Locale {
|
||||
val locale = Locale.getDefault()
|
||||
if (locale.language == "csb") {
|
||||
return Locale.forLanguageTag("pl")
|
||||
}
|
||||
return locale
|
||||
}
|
||||
|
||||
fun LocalDate.toTimestamp(): Long = atStartOfDay()
|
||||
.toInstant(ZoneOffset.UTC)
|
||||
.toEpochMilli()
|
||||
|
@ -41,7 +23,7 @@ fun String.toLocalDate(format: String = DEFAULT_DATE_PATTERN): LocalDate =
|
|||
LocalDate.parse(this, DateTimeFormatter.ofPattern(format))
|
||||
|
||||
fun LocalDate.toFormattedString(pattern: String = DEFAULT_DATE_PATTERN): String =
|
||||
format(DateTimeFormatter.ofPattern(pattern, getDefaultLocaleWithFallback()))
|
||||
format(DateTimeFormatter.ofPattern(pattern))
|
||||
|
||||
fun Instant.toFormattedString(
|
||||
pattern: String = DEFAULT_DATE_PATTERN,
|
||||
|
@ -49,7 +31,7 @@ fun Instant.toFormattedString(
|
|||
): String = atZone(tz).format(DateTimeFormatter.ofPattern(pattern))
|
||||
|
||||
fun Month.getFormattedName(): String {
|
||||
val formatter = SimpleDateFormat("LLLL", getDefaultLocaleWithFallback())
|
||||
val formatter = SimpleDateFormat("LLLL", Locale.getDefault())
|
||||
|
||||
val date = LocalDateTime.now().withMonth(value)
|
||||
return formatter.format(date.toInstant(ZoneOffset.UTC).toEpochMilli()).capitalise()
|
||||
|
@ -94,7 +76,7 @@ inline val LocalDate.previousOrSameSchoolDay: LocalDate
|
|||
}
|
||||
|
||||
inline val LocalDate.weekDayName: String
|
||||
get() = format(DateTimeFormatter.ofPattern("EEEE", getDefaultLocaleWithFallback()))
|
||||
get() = format(DateTimeFormatter.ofPattern("EEEE", Locale.getDefault()))
|
||||
|
||||
inline val LocalDate.monday: LocalDate get() = with(MONDAY)
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minut</item>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minutów</item>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 Minuten</item>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minut</item>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 минут</item>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minút</item>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 хвилин</item>
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="app_language_values" translatable="false">
|
||||
<item>system</item>
|
||||
|
@ -51,7 +50,6 @@
|
|||
<item>de</item>
|
||||
<item>cs</item>
|
||||
<item>sk</item>
|
||||
<item>csb</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="services_interval_entries">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.9.24'
|
||||
about_libraries = '11.2.1'
|
||||
about_libraries = '11.1.4'
|
||||
hilt_version = '2.51.1'
|
||||
}
|
||||
repositories {
|
||||
|
|
Reference in a new issue