mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
Add '.' (period, dot, ..) to FormatLiterals so that ss.fff can work. (#23861)
Honestly, to me the entire design of a (highly!) restricted set of `FormatLiterals` characters seems antithetical to the very idea of a format string template. Fixing that is a much larger change, though. So, this PR just adds `'.'` so that the standard (both input & output!) notation for decimal numbers in Nim can be used for the seconds part of a time format in `lib/pure/times.format(.., f)`. It should only make legal what was illegal and should be harmless since `'.'` is not used in any special way otherwise.
This commit is contained in:
@@ -1631,7 +1631,7 @@ const
|
||||
"Sunday"],
|
||||
)
|
||||
|
||||
FormatLiterals = {' ', '-', '/', ':', '(', ')', '[', ']', ','}
|
||||
FormatLiterals = {' ', '-', '/', ':', '(', ')', '[', ']', ',', '.'}
|
||||
|
||||
proc `$`*(f: TimeFormat): string =
|
||||
## Returns the format string that was used to construct `f`.
|
||||
|
||||
Reference in New Issue
Block a user