Since the recent updates, Grid.represent_by_type started working. Its datetime/date/time represent functions were using document.write, a old deprecated API with bad behaviour (like replacing the entire page content if the script tag happens to be written later through ajax).
In this PR
https://github.com/web2py/py4web/pull/1000 i replace that by using insertAdjacentText instead, which has essentially the same effect.
i've also switched it to using f-strings and js isoformat parsing, because its far nicer code this way