mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gen: auto_str_methods.v
This commit is contained in:
@@ -35,6 +35,7 @@ const (
|
||||
31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
|
||||
31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31,
|
||||
]
|
||||
long_days= ['Monday', 'Tuesday', 'Wednesday', 'Thusday', 'Friday', 'Saturday', 'Sunday']
|
||||
)
|
||||
|
||||
pub struct Time {
|
||||
@@ -272,6 +273,12 @@ pub fn (t Time) weekday_str() string {
|
||||
return days_string[i * 3..(i + 1) * 3]
|
||||
}
|
||||
|
||||
// weekday_str returns the current day as a string.
|
||||
pub fn (t Time) long_weekday_str() string {
|
||||
i := t.day_of_week() - 1
|
||||
return long_days[i]
|
||||
}
|
||||
|
||||
// ticks returns a number of milliseconds elapsed since system start.
|
||||
pub fn ticks() i64 {
|
||||
$if windows {
|
||||
|
||||
Reference in New Issue
Block a user