8000 Problem with dates in YYYY-MM-DD format · Issue #167 · volosoft/jtable · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Problem with dates in YYYY-MM-DD format #167

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

Closed
phila42 opened this issue Jan 31, 2013 · 5 comments
Closed

Problem with dates in YYYY-MM-DD format #167

phila42 opened this issue Jan 31, 2013 · 5 comments
Assignees
Labels
Milestone

Comments

@phila42
Copy link
phila42 commented Jan 31, 2013

The function _parseDate has a problem with dates in the format YYYY-MM-DD - try parsing 2012-09-26, for example.

What happens is that parseInt('09') gets called for the month - Javascript treats this as an invalid OCTAL number and returns 0!

The fix is to call parseInt with an explicit radix, e.g. parseInt('09', 10) - this returns 9, as expected.

@ghost ghost assigned hikalkan Jan 31, 2013
@hikalkan
Copy link
Member

Thanks for your feedback. I'll check it and fix if it has problems.

hikalkan added a commit that referenced this issue Feb 13, 2013
Support for saving page size preference of user. [#219]
Fixed some issues. [#167, #214, #215, #216, #219, #231]
Added 'Dutch - The Netherlands' localization.
Updated some localization files.
gbisheimer pushed a commit to gbisheimer/jtable that referenced this issue Feb 13, 2013
Support for saving page size preference of user. [volosoft#219]
Fixed some issues. [volosoft#167, volosoft#214, volosoft#215, volosoft#216, volosoft#219, volosoft#231]
Added 'Dutch - The Netherlands' localization.
Updated some localization files.
@ghost
Copy link
ghost commented May 15, 2013

I think the problem is not solved with this release also. I am having date format "dd MMM yyyy" from the backend. When jtable parses it is throwing date.getDate is not a function.

@ghost
Copy link
ghost commented May 15, 2013

Date format is as below in my js file

RecordDate : {title : 'Date', width : '40%', type:'date', displayFormat: 'dd mm yy' },

@gbisheimer
Copy link
Contributor

I written a jtable extension some time ago that parses date-time fields. It uses the following function for parsing and formatting date/time fields:

https://github.com/gbisheimer/jtable/blob/datetime_extension/lib/extensions/date.format.js

Check it out, it may help you with your problem.

@ghost
Copy link
ghost commented May 15, 2013

Thanks ! Obviously it is helpful :)

61F0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0