mirror of
https://github.com/idanoo/NZCovidBot
synced 2025-07-01 19:22:14 +00:00
Update date format
This commit is contained in:
parent
1b9339c371
commit
cbd230fdc4
2 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.2
|
||||||
|
- Change lastUpdated to pointer reference
|
||||||
|
- Change date format to support multiple dates in single point of interest
|
||||||
|
|
||||||
## 1.1
|
## 1.1
|
||||||
- Split messages based on location
|
- Split messages based on location
|
||||||
- Added systemd service
|
- Added systemd service
|
||||||
|
|
|
@ -56,7 +56,7 @@ func fetchAPILocations() (ApiResponse, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set user-agent info
|
// Set user-agent info
|
||||||
req.Header.Set("User-Agent", "NZCovidBot/1.1 (https://m2.nz)")
|
req.Header.Set("User-Agent", "NZCovidBot/1.2 (https://m2.nz)")
|
||||||
|
|
||||||
// Fire off the request
|
// Fire off the request
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
@ -156,8 +156,8 @@ func (item ApiItem) getDateString() string {
|
||||||
st := item.StartDateTime
|
st := item.StartDateTime
|
||||||
et := item.EndDateTime
|
et := item.EndDateTime
|
||||||
|
|
||||||
dateFormat := "Mon 2 Jan, 03:04PM"
|
dateFormat := "Mon Jan 2nd 3:04PM"
|
||||||
timeFormat := "03:04PM"
|
timeFormat := "2nd 3:04PM"
|
||||||
|
|
||||||
return st.Local().Format(dateFormat) + " - " + et.Local().Format(timeFormat)
|
return st.Local().Format(dateFormat) + " - " + et.Local().Format(timeFormat)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue