Skip to content

Commit

Permalink
Replacing last remaining Date pointers with zero values
Browse files Browse the repository at this point in the history
  • Loading branch information
twystd committed May 31, 2024
1 parent bf109fd commit cea80cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions commands/add_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ func (c *AddTask) getTaskActive(args []string) (*types.Date, *types.Date, error)
var from *types.Date
var to *types.Date

if date, err := types.DateFromString(match[1]); err != nil {
if date, err := types.ParseDate(match[1]); err != nil {
return nil, nil, fmt.Errorf("%v: invalid 'from' date (%v)", match[1], err)
} else {
from = &date
}

if date, err := types.DateFromString(match[2]); err != nil {
if date, err := types.ParseDate(match[2]); err != nil {
return nil, nil, fmt.Errorf("%v: invalid 'to' date (%v)", match[1], err)
} else {
to = &date
Expand Down
4 changes: 2 additions & 2 deletions commands/set_time_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ func (c *SetTimeProfile) Execute(ctx Context) error {
for _, arg := range args[3:] {
// from:to
if match := regexp.MustCompile("([0-9]{4}-[0-9]{2}-[0-9]{2}):([0-9]{4}-[0-9]{2}-[0-9]{2})").FindStringSubmatch(arg); match != nil {
if date, err := types.DateFromString(match[1]); err != nil {
if date, err := types.ParseDate(match[1]); err != nil {
return fmt.Errorf("%v: invalid 'start' date (%v)", match[1], err)
} else {
from = &date
}

if date, err := types.DateFromString(match[2]); err != nil {
if date, err := types.ParseDate(match[2]); err != nil {
return fmt.Errorf("%v: invalid 'to' date (%v)", match[1], err)
} else {
to = &date
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/uhppoted/uhppote-cli
go 1.22

require (
github.com/uhppoted/uhppote-core v0.8.9-0.20240530164535-c743e72dd723
github.com/uhppoted/uhppoted-lib v0.8.9-0.20240530171621-d3485dd0b34d
github.com/uhppoted/uhppote-core v0.8.9-0.20240531170136-432a5b0fbb8b
github.com/uhppoted/uhppoted-lib v0.8.9-0.20240531170312-cb08695b7cc2
)

require golang.org/x/sys v0.20.0 // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github.com/uhppoted/uhppote-core v0.8.9-0.20240530164535-c743e72dd723 h1:itDcd2d0Iz23IWG+Vl6kj8MqPM/mv4C097O5hUCkLYg=
github.com/uhppoted/uhppote-core v0.8.9-0.20240530164535-c743e72dd723/go.mod h1:Q+DHtT8s74efLs2b0eF20DRBUL9yBkySwaTQ+0lsEVM=
github.com/uhppoted/uhppoted-lib v0.8.9-0.20240530171621-d3485dd0b34d h1:tF9pdfTgbUfdP2tQ9/H/olYEHkXVh+aDiuq0DatcdFQ=
github.com/uhppoted/uhppoted-lib v0.8.9-0.20240530171621-d3485dd0b34d/go.mod h1:luEG0DJWxSzCTDqYkqvE+T0HP59LKDUJ4iZHGn84C6w=
github.com/uhppoted/uhppote-core v0.8.9-0.20240531170136-432a5b0fbb8b h1:alKlb6od5XjvzOfaJRW28M6LOzrxseW7VgWr9q4M+WM=
github.com/uhppoted/uhppote-core v0.8.9-0.20240531170136-432a5b0fbb8b/go.mod h1:Q+DHtT8s74efLs2b0eF20DRBUL9yBkySwaTQ+0lsEVM=
github.com/uhppoted/uhppoted-lib v0.8.9-0.20240531170312-cb08695b7cc2 h1:Slbb2pwoiZ1CTjfFUDhx4E5AD6qv6Eq2cBiTUcoos/E=
github.com/uhppoted/uhppoted-lib v0.8.9-0.20240531170312-cb08695b7cc2/go.mod h1:pg8dPLgY+Faru4Zc5Et0Q/bq5lbKU420/VdXQLkkjCE=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

0 comments on commit cea80cb

Please sign in to comment.