toml: fix test
parent
8f1cd11a0a
commit
f1f46850aa
|
|
@ -204,7 +204,11 @@ fn to_burntsushi(value ast.Value) string {
|
|||
ast.DateTime {
|
||||
// Normalization for json
|
||||
json_text := json2.Any(value.text).json_str().to_upper().replace(' ', 'T')
|
||||
typ := if json_text.ends_with('Z') || json_text.all_after('T').contains('-')
|
||||
|
||||
// NB: Since encoding strings in JSON now automatically includes quotes,
|
||||
// I added a somewhat a workaround by adding an ending quote in order to
|
||||
// recognize properly the date time type. - Ned
|
||||
typ := if json_text.ends_with('Z"') || json_text.all_after('T').contains('-')
|
||||
|| json_text.all_after('T').contains('+') {
|
||||
'datetime'
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue