I am attempting to understand how date parsing in Vegalite works. Specifically, I am a bit confused in my understanding of default timezone assumptions and date parsing from a non-timezone denoted string.
Consider the minimal example that works
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": [
{"date": "2020-10-01", "distance": 1},
{"date": "2020-11-01", "distance": 5}
]
},
"mark": "bar",
"encoding": {
"x": {"field": "date",
"type": "temporal",
"timeUnit": {"unit": "yearmonthdate", "utc": true},
"axis": {"format": "%b. %y"}
},
"y": {"field": "distance", "aggregate": "sum"}
}
}
In the above example, if I omit the line (or just the utc
flag):
"timeUnit": {"unit": "yearmonthdate", "utc": true}
the dates seem to get parsed as:
Wed, 30 Sep 2020 05:00:00 GMT
Sat, 31 Oct 2020 05:00:00 GMT
Any guidance or explanation on the default assumption here would be extremely helpful. I understand from the docs that given non-ISO string inputs, Vega will parse times as local (https://vega.github.io/vega-lite/docs/timeunit.html#utc) but that does not seem to be the case here?
Thank you
"tooltip": [ "field": "date", "title": "Date", "format": null, "type": "temporal", "timeUnit": { "unit": "yearmonthdate", "utc": true } } ]
– Hedjaz