Skip to content

Commit

Permalink
Allow incompletely specified Time Formats (#8816)
Browse files Browse the repository at this point in the history
* Allow incompletely specified time formats

* Adjust error reporting slightly

* Update setting.go
  • Loading branch information
zeripath authored and techknowlogick committed Dec 8, 2019
1 parent be06dee commit baae90e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,8 @@ func NewContext() {
TimeFormat = timeFormatKey
TestTimeFormat, _ := time.Parse(TimeFormat, TimeFormat)
if TestTimeFormat.Format(time.RFC3339) != "2006-01-02T15:04:05Z" {
log.Fatal("Can't create time properly, please check your time format has 2006, 01, 02, 15, 04 and 05")
log.Warn("Provided TimeFormat: %s does not create a fully specified date and time.", TimeFormat)
log.Warn("In order to display dates and times correctly please check your time format has 2006, 01, 02, 15, 04 and 05")
}
log.Trace("Custom TimeFormat: %s", TimeFormat)
}
Expand Down

0 comments on commit baae90e

Please sign in to comment.