diff --git a/cmd/tools/vdoc/theme/doc.css b/cmd/tools/vdoc/theme/doc.css index bfa76839f26e28..cf99c739f89e05 100644 --- a/cmd/tools/vdoc/theme/doc.css +++ b/cmd/tools/vdoc/theme/doc.css @@ -36,6 +36,8 @@ --attribute-deprecated-background-color: #f59f0b48; --attribute-deprecated-text-color: #92400e; --attribute-text-color: #000000cf; + --table-header-line-color: #2c3e64; + --table-background-color: #edf2f7; } html.dark { --background-color: #1a202c; @@ -73,6 +75,8 @@ html.dark { --attribute-background-color: #ffffff20; --attribute-text-color: #ffffffaf; --attribute-deprecated-text-color: #fef3c7; + --table-header-line-color: #cbd5e0; + --table-background-color: #2d3748; } html.dark .dark-icon { display: none; @@ -665,6 +669,21 @@ pre { margin: 0 0 0.4rem 0; } +table { + border: 1px solid var(--table-background-color); + border-collapse: collapse; +} +table tr td, +table tr th { + padding: 4px 8px; +} +table tr th { + background-color: var(--table-background-color); +} +tr:nth-child(even) { + background-color: var(--table-background-color); +} + /* Medium screen and up */ @media (min-width: 768px) { *::-webkit-scrollbar { diff --git a/vlib/time/format.v b/vlib/time/format.v index dcdd15a3fb366f..ae42e6f34283fd 100644 --- a/vlib/time/format.v +++ b/vlib/time/format.v @@ -287,37 +287,37 @@ const tokens_4 = ['MMMM', 'DDDD', 'DDDo', 'dddd', 'YYYY'] // custom_format returns a date with custom format // -// | | Token | Output | -// |-----------------:|:------|:---------------------------------------| -// | **Month** | M | 1 2 ... 11 12 | +// | Category | Token | Output | +// |:-----------------|:------|:---------------------------------------| +// | Era | N | BC AD | +// | | NN | Before Christ, Anno Domini | +// | Year | YY | 70 71 ... 29 30 | +// | | YYYY | 1970 1971 ... 2029 2030 | +// | Quarter | Q | 1 2 3 4 | +// | | QQ | 01 02 03 04 | +// | | Qo | 1st 2nd 3rd 4th | +// | Month | M | 1 2 ... 11 12 | // | | Mo | 1st 2nd ... 11th 12th | // | | MM | 01 02 ... 11 12 | // | | MMM | Jan Feb ... Nov Dec | // | | MMMM | January February ... November December | -// | **Quarter** | Q | 1 2 3 4 | -// | | QQ | 01 02 03 04 | -// | | Qo | 1st 2nd 3rd 4th | -// | **Day of Month** | D | 1 2 ... 30 31 | +// | Week of Year | w | 1 2 ... 52 53 | +// | | wo | 1st 2nd ... 52nd 53rd | +// | | ww | 01 02 ... 52 53 | +// | Day of Month | D | 1 2 ... 30 31 | // | | Do | 1st 2nd ... 30th 31st | // | | DD | 01 02 ... 30 31 | -// | **Day of Year** | DDD | 1 2 ... 364 365 | +// | Day of Year | DDD | 1 2 ... 364 365 | // | | DDDo | 1st 2nd ... 364th 365th | // | | DDDD | 001 002 ... 364 365 | -// | **Day of Week** | d | 0 1 ... 5 6 (Sun-Sat) | +// | Day of Week | d | 0 1 ... 5 6 (Sun-Sat) | // | | c | 1 2 ... 6 7 (Mon-Sun) | // | | dd | Su Mo ... Fr Sa | // | | ddd | Sun Mon ... Fri Sat | // | | dddd | Sunday Monday ... Friday Saturday | -// | **Week of Year** | w | 1 2 ... 52 53 | -// | | wo | 1st 2nd ... 52nd 53rd | -// | | ww | 01 02 ... 52 53 | -// | **Year** | YY | 70 71 ... 29 30 | -// | | YYYY | 1970 1971 ... 2029 2030 | -// | **Era** | N | BC AD | -// | | NN | Before Christ, Anno Domini | -// | **AM/PM** | A | AM PM | +// | AM/PM | A | AM PM | // | | a | am pm | -// | **Hour** | H | 0 1 ... 22 23 | +// | Hour | H | 0 1 ... 22 23 | // | | HH | 00 01 ... 22 23 | // | | h | 1 2 ... 11 12 | // | | hh | 01 02 ... 11 12 | @@ -325,11 +325,11 @@ const tokens_4 = ['MMMM', 'DDDD', 'DDDo', 'dddd', 'YYYY'] // | | ii | 00 01 ... 11 12 01 ... 11 | // | | k | 1 2 ... 23 24 | // | | kk | 01 02 ... 23 24 | -// | **Minute** | m | 0 1 ... 58 59 | +// | Minute | m | 0 1 ... 58 59 | // | | mm | 00 01 ... 58 59 | -// | **Second** | s | 0 1 ... 58 59 | +// | Second | s | 0 1 ... 58 59 | // | | ss | 00 01 ... 58 59 | -// | **Offset** | Z | -7 -6 ... +5 +6 | +// | Offset | Z | -7 -6 ... +5 +6 | // | | ZZ | -0700 -0600 ... +0500 +0600 | // | | ZZZ | -07:00 -06:00 ... +05:00 +06:00 | // diff --git a/vlib/time/parse.c.v b/vlib/time/parse.c.v index 4751b1c37698f5..7d6315fef5b5dc 100644 --- a/vlib/time/parse.c.v +++ b/vlib/time/parse.c.v @@ -132,29 +132,31 @@ pub fn parse(s string) !Time { // parse_format parses the string `s`, as a custom `format`, containing the following specifiers: // -// - YYYY - 4 digit year, 0000..9999 -// - YY - 2 digit year, 00..99 -// - M - month, 1..12 -// - MM - month, 2 digits, 01..12 -// - MMM - month, three letters, Jan..Dec -// - MMMM - name of month -// - D - day of the month, 1..31 -// - DD - day of the month, 01..31 -// - d - day of week, 0..6 -// - c - day of week, 1..7 -// - dd - day of week, Su..Sa -// - ddd - day of week, Sun..Sat -// - dddd - day of week, Sunday..Saturday -// - H - hour, 0..23 -// - HH - hour, 00..23 -// - h - hour, 0..23 -// - hh - hour, 0..23 -// - k - hour, 0..23 -// - kk - hour, 0..23 -// - m - minute, 0..59 -// - mm - minute, 0..59 -// - s - second, 0..59 -// - ss - second, 0..59 +// |Category| Format | Description | +// |:----- | :----- | :---------- | +// |Year | YYYY | 4 digit year, 0000..9999 | +// | | YY | 2 digit year, 00..99 | +// |Month | M | month, 1..12 | +// | | MM | month, 2 digits, 01..12 | +// | | MMM | month, three letters, Jan..Dec | +// | | MMMM | name of month | +// |Day | D | day of the month, 1..31 | +// | | DD | day of the month, 01..31 | +// | | d | day of week, 0..6 | +// | | c | day of week, 1..7 | +// | | dd | day of week, Su..Sa | +// | | ddd | day of week, Sun..Sat | +// | | dddd | day of week, Sunday..Saturday | +// |Hour | H | hour, 0..23 | +// | | HH | hour, 00..23 | +// | | h | hour, 0..23 | +// | | hh | hour, 0..23 | +// | | k | hour, 0..23 | +// | | kk | hour, 0..23 | +// |Minute | m | minute, 0..59 | +// | | mm | minute, 0..59 | +// |Second | s | second, 0..59 | +// | | ss | second, 0..59 | pub fn parse_format(s string, format string) !Time { if s == '' { return error_invalid_time(0, 'datetime string is empty')