From c645fb3812202e190818233d9b599ec3f6074a75 Mon Sep 17 00:00:00 2001 From: Benjamin VAUDOUR Date: Sat, 17 Feb 2024 19:00:25 +0100 Subject: [PATCH] =?UTF-8?q?M=C3=A0j=20des=20d=C3=A9pendances=20+=20ajout?= =?UTF-8?q?=20du=20module=20number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datetime/datetime.go | 8 ++++++-- go.mod | 4 ++-- go.sum | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/datetime/datetime.go b/datetime/datetime.go index ebb92bc..60ae892 100644 --- a/datetime/datetime.go +++ b/datetime/datetime.go @@ -75,8 +75,12 @@ func (dt datetime) add(y, m, d, h, i int, e ...int) datetime { p, v = PrecisionMillisecond, v+e[1] } } - dc := v / MillisecondPerDay - d, v = d+dc, v-dc*MillisecondPerDay + d += v / MillisecondPerDay + v %= MillisecondPerDay + if v < 0 { + d-- + v += MillisecondPerDay + } return newDT(dt.date.add(y, m, d), newC(uint(v), p)) } func (dt datetime) addT(y, m, d int) datetime { return newDT(dt.date.add(y, m, d), dt.clock) } diff --git a/go.mod b/go.mod index 184b15e..f0b8f27 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module gitea.zaclys.com/bvaudour/gob -go 1.21 +go 1.22 -require golang.org/x/crypto v0.13.0 +require golang.org/x/crypto v0.19.0 diff --git a/go.sum b/go.sum index 8886ba7..b3dc059 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=