mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: do not panic on time.new_time({unix: 1608854400}).str()
This commit is contained in:
@ -133,6 +133,9 @@ pub fn utc() Time {
|
||||
|
||||
// smonth returns month name.
|
||||
pub fn (t Time) smonth() string {
|
||||
if t.month <= 0 || t.month > 12 {
|
||||
return '---'
|
||||
}
|
||||
i := t.month - 1
|
||||
return months_string[i * 3..(i + 1) * 3]
|
||||
}
|
||||
|
Reference in New Issue
Block a user