CHANGE: added default 1 Month Limit for bookings
This commit is contained in:
@@ -62,8 +62,8 @@ func getBookings(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
tsFrom, err := parseTimestamp(r, "time_from", "2000-01-01")
|
||||
// TODO add config for timeoffset
|
||||
tsFrom, err := parseTimestamp(r, "time_from", time.Now().AddDate(0, -1, 0).Format("2006-01-02"))
|
||||
if(err != nil ){
|
||||
log.Println("Error parsing 'from' time", err)
|
||||
http.Error(w, "Timestamp 'from' cannot be parsed!", http.StatusBadRequest)
|
||||
|
||||
Reference in New Issue
Block a user