Turn updateDateTime into *Date.Update

This commit is contained in:
2024-10-20 15:47:10 +02:00
parent da5d955b2d
commit 0b70a8ee10
4 changed files with 32 additions and 33 deletions

View File

@@ -24,6 +24,15 @@ func NewDate(t time.Time) *Date {
}
}
// Update updates the Date.
func (d *Date) Update() {
if d == nil {
d = NewDate(time.Now())
} else {
d.DateTime = DateTime(time.Now())
}
}
// Check checks the Date for incompatibilities with RFC4287. It returns an
// error.
func (d *Date) Check() error {