mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
added weekday string method
This commit is contained in:
parent
ebc3fb9378
commit
fe19d6a62e
@ -133,6 +133,7 @@ pub fn (t Time) format() string {
|
||||
|
||||
const (
|
||||
Months = 'JanFebMarAprMayJunJulAugSepOctNovDec'
|
||||
Days = 'MonTueWedThuFriSatSun'
|
||||
)
|
||||
|
||||
pub fn (t Time) smonth() string {
|
||||
@ -332,3 +333,7 @@ pub fn (t Time) day_of_week() int {
|
||||
return day_of_week(t.year, t.month, t.day)
|
||||
}
|
||||
|
||||
pub fn (t Time) weekday_str() string {
|
||||
i := t.day_of_week() - 1
|
||||
return Days.substr(i * 3, (i + 1) * 3)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user