google-code-export / oragoods

Automatically exported from code.google.com/p/oragoods
1 stars 0 forks source link

Date conversion is off by one month #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a data source that produces a datetime result
2. Convert the results to json format using oragoods

What is the expected output?

 {"v": new Date(2010,10,2,0,0,0), "f": "2010-11-02 00:00:00"},

What do you see instead?

 {"v": new Date(2010,11,2,0,0,0), "f": "2010-11-02 00:00:00"},

I believe all you have to modify is the following twice in the get_json() 
function:

 NVL (trim (leading '0' FROM TO_CHAR (v_col_date, 'mm') - 1), '0')

(note the -1, Javascript months start at 0 instead of 1)

Original issue reported on code.google.com by alex.iri...@gmail.com on 22 Feb 2011 at 9:46

GoogleCodeExporter commented 9 years ago
Thanks, you are right! That's probably the issue.
I'm on vacations, I'll fix the problems once I return in a couple of weeks.

Original comment by jose.can...@gmail.com on 22 Feb 2011 at 12:13

GoogleCodeExporter commented 9 years ago

Original comment by jose.can...@gmail.com on 22 Feb 2011 at 12:14