-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with dates #48
Comments
Good find! I'd consider this an oversight / bug of the JS library implementation (the translation from JS types to MistQL types isn't yet robustly specified), but dates should almost certainly be translated as ISO 8601 compliant strings. Formalizing this will be incredibly useful to do. An additional possibility is adding a core "date" type to MistQL, but honestly that would add a LOT of complexity, not just for the specification of the language, but the interface to it. |
My suggestion is to not assume a single date serialization format like 8601 and instead provide date helper functions that can be used to deal with all different types of date handling situations. SQLite's handling of date comes to mind. They don't actually have a date type but some functions that make it easy to deal with parsing and formatting dates. |
@cfilipov 100% agree -- to me it feels like the right choice is to lean on existing datatypes and leverage helpers to assist in date processing. The translation from JS Date type to MistQL would need to be standardized, which is where 8601 comes in. |
Going to adopt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify Edit: I thought a few of the translations would be a bit unintuitive, so I've changed them a little. |
Probably a good idea to keep this issue open, as we'll need at least a few date helpers. |
all but forgot about python here. Aiming to make |
Hello, I am very interested to see how this project goes, the idea seems great and using it looks simple but powerful. However I ran into this problem when working with arrays with dates. Maybe there's something I haven't learned yet seeing as I'm as new to this as the language :^), but the Date Objects are empty. Good luck on this project!
The text was updated successfully, but these errors were encountered: