-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
- Platform: macOS 10.13
- Database: Postgres 9.6
- Lux Version: 1.2.2
- Node Version: 8.6.0
Requesting a resource with a link like /my-resource?forDate=2017-10-11T00:00:00.000Z&filter[id]=123,124 gives a Date object for the forDate param. Currently the create-query-string function has no knowledge of correctly serializing a date which results in a page link like: /my-resource?&filter[id]=123,124 which is invalid.
Can be solved by modifying create-page-links to:
if (value && typeof value === 'object') {
if (Array.isArray(value)) {
result += value.map(encodeURIComponent).join();
} else if(value instanceof Date) {
result += value.toISOString();
} else {
result = (
result.substr(0, result.length - (key.length + 1))
+ createQueryString(value, key)
);
}
} else if (!value && typeof value !== 'number') {
result += 'null';
} else {
result += encodeURIComponent(value);
}
}This does expect the user to use ISO8601 dates.
Metadata
Metadata
Assignees
Labels
No labels