Allow the user to set time zone

Fix timezone handling for periodic tasks
This commit is contained in:
eikek
2022-03-01 21:40:23 +01:00
parent 6f7eafcebc
commit 9545431d59
21 changed files with 186 additions and 72 deletions

View File

@ -33,7 +33,7 @@ object EmptyTrashArgs {
val taskName = Ident.unsafe("empty-trash")
val defaultSchedule = CalEvent.unsafe("*-*-1/7 03:00:00")
val defaultSchedule = CalEvent.unsafe("*-*-1/7 03:00:00 UTC")
def periodicTaskId(coll: Ident): Ident =
Ident.unsafe(s"docspell") / taskName / coll

View File

@ -6,10 +6,8 @@
package docspell.common
import java.time.LocalDateTime
import java.time.ZonedDateTime
import java.time.temporal.ChronoUnit
import java.time.{Instant, LocalDate, ZoneId}
import java.time.{Duration => _, _}
import cats.effect.Sync
@ -57,7 +55,7 @@ case class Timestamp(value: Instant) {
}
object Timestamp {
val UTC = ZoneId.of("UTC")
val UTC: ZoneId = ZoneOffset.UTC
val Epoch = Timestamp(Instant.EPOCH)