Closed ppaglier closed 3 years ago
You should emit it via a timestamp as e.g. Long.
You can simply send the date as JSON with toJSON
or as a ISO string, as a timestamp etc.
Also it would probably make problems across different time zones.
Dates aren't a commonly used data structure so there isn't really a need to add them as a MValue.
You should emit it via a timestamp as e.g. Long.
You can simply send the date as JSON with
toJSON
or as a ISO string, as a timestamp etc. Also it would probably make problems across different time zones. Dates aren't a commonly used data structure so there isn't really a need to add them as a MValue.
Yes, but if a send an array or multiples values wich contains dates (like an array of object which contains maybe an other array of object that contains a Date), i need to make a loop or format all dates before sending them, then after i recieved them, i need to recreate Date manually to use it as a Date
I dont think we can add a own mvalue for each possible Platform Type.
You cannot expect other modules to add support for nonexistent types, e.g javascript Date, please use timestamp.
Suggestion
In Javascript, when you send a date (class Date), you should receive a date (class Date), because actually when you send a Date, you recieve an empty Object
Use cases
Sending date in emit/emitClient/emitServer whithout format the date to timestamp or ISO
Describe the solution you'd like
When you send a Date, you should recieve a date (class Date) or formated date (ISO or timestamp)
Describe alternatives you've considered
The only way i found for doing this without any update is to format the date to ISO or timestamp before sending data, then create Date by the ISO or timestamp
Additional context
and the current result is :
but it should be this