1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: 1 error left

This commit is contained in:
Alexander Medvednikov
2020-03-20 20:35:00 +01:00
parent 8077a7534e
commit 4b36098e07
4 changed files with 14 additions and 7 deletions

View File

@@ -110,7 +110,7 @@ pub fn (t Time) get_fmt_date_str(fmt_dlmtr FormatDelimiter, fmt_date FormatDate)
}
month := '${t.smonth()}'
year := t.year.str()[2..]
return match fmt_date {
mut res := match fmt_date {
.ddmmyy{
'${t.day:02d}|${t.month:02d}|$year'
}
@@ -136,7 +136,8 @@ pub fn (t Time) get_fmt_date_str(fmt_dlmtr FormatDelimiter, fmt_date FormatDate)
'${t.year}|${t.month:02d}|${t.day:02d}'
}
else {
'unknown enumeration $fmt_date'}}.replace('|', match fmt_dlmtr {
'unknown enumeration $fmt_date'}}
res = res.replace('|', match fmt_dlmtr {
.dot{
'.'
}
@@ -151,6 +152,7 @@ pub fn (t Time) get_fmt_date_str(fmt_dlmtr FormatDelimiter, fmt_date FormatDate)
}
else {
'unknown enumeration $fmt_dlmtr'}})
return res
}
// get_fmt_str returns a date string with specified FormatDelimiter,