Skip to content

Commit

Permalink
Merge pull request #38 from observerly/fix/routes/timeDefaultQuery
Browse files Browse the repository at this point in the history
fix: Amended time.RFC3339() parsing for datetime related c.DefaultQuery().
  • Loading branch information
michealroberts authored Feb 14, 2023
2 parents 1d44f31 + 3f1be4d commit b1178fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/moon/moon.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// GET /moon
func GetMoon(c *gin.Context) {
d := c.DefaultQuery("datetime", time.Now().String())
d := c.DefaultQuery("datetime", time.Now().Format(time.RFC3339))

lon := c.DefaultQuery("longitude", strconv.Itoa(0))

Expand Down
2 changes: 1 addition & 1 deletion pkg/sun/sun.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// GET Sun
func GetSun(c *gin.Context) {
d := c.DefaultQuery("datetime", time.Now().String())
d := c.DefaultQuery("datetime", time.Now().Format(time.RFC3339))

lon := c.DefaultQuery("longitude", strconv.Itoa(0))

Expand Down
2 changes: 1 addition & 1 deletion pkg/transit/transit.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// GET Transit
func GetTransit(c *gin.Context) {
d := c.DefaultQuery("datetime", time.Now().String())
d := c.DefaultQuery("datetime", time.Now().Format(time.RFC3339))

ra := c.DefaultQuery("ra", strconv.Itoa(0))

Expand Down

0 comments on commit b1178fd

Please sign in to comment.