-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
dateStrings not implemented. #99
Comments
Yes, it's currently ignored. I'll add support for this option in next release |
thanks!! |
published as v0.12.1 Note that it's a boolean option ( though if you set it to 'DATE' string it's still treated as truthy ) |
Your the bomb! I'll keep on mind that it's a boolean and just set it to true :) Andrey Sidorov [email protected] wrote:
|
I really only want DATE fields to be treated as strings but not DATETIME fields. I see that mysqljs/mysql now supports an array of types for In their Connection Options:
|
wow, I missed that this was added to mysqljs/mysql it's relatively simple change - would you like to try adding it @kbsanders ? Let me know if you need any help navigating the code |
@sidorares Thanks for the quick reply. If I find time in the next few days I will submit a PR. In the meantime, I'm using this workaround of providing a // NOTE: only works for .query() calls and not .execute() calls.
typeCast: function ( field, next ) {
if ( field.type === "DATE" ) {
return field.string();
}
return next();
} Along the way I discovered that |
This aligns the `dateStrings` with mysqljs, allowing to set `dateStrings: ['DATE']` to return the DATE type as string, but keeping other datetime types processed to Date. Related: sidorares#99
I tried the other dateStrings commands and they didn't work. So I just installed the original and the dateStrings method works just fine.
The text was updated successfully, but these errors were encountered: