-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
dates are ignored when building query strings #22
Comments
We'd be interested in a PR for this. It might make a nice contribution. If you do that, we probably need a pluggable way to change the dater (de)serialization. |
Any ideas for how we could make it pluggable? I'm game to make a PR for this. Also, what do you think is the best method for making a suitable date string? this? |
Just try something out and submit a PR, then we can go back and forth refining it, get a few more eyes on it, etc. and work it until we all have it where we want it. That's my recommendation. |
👍 we have to work around this now. It's a matter of doing .toString and constructing the Date with the same string again when converting back. |
Both encodeURIComponent $.param ISO / JSON.stringify() I prefer ISO. This is how dates are serialized in JSON payloads and I don't know about other backends but a .Net WebApi would deserialize ISO dates with no extra effort. @EisenbergEffect if you pick a format, we may be able to send in a PR. |
What if we go with ISO but have a way to configure it with another implementation? |
looks like this wish came true. Line 149 in 2905f85
|
I'm submitting a bug report
1.0.0
Please tell us about your environment:
Windows 10
5.11.1
3.10.5
JSPM 0.16.39
All probably. Chrome 52.0.2743.116 m (64-bit)
ESNext
Current behavior:
Dates are not made into parameters they are ignored. This is as a result of the
if (typeof (value) === 'object')
check on line 128 resolving true for dates.Expected/desired behavior:
gist.run is down(??) so I can't show the behaviour currently.
I believe line 128 should also check that it is not a date and let it fall through into the else block so that the date is present in the query string.
I can't put dates directly in query strings, though I appreciate it's probably wise to format the date explicitly first into a string and will be my local work around/fix.
The text was updated successfully, but these errors were encountered: