Hi. Try using a GregorianCalendar object instead of Date, this should solve your problems. Let us know if you still have problems.
Best, Viz Kid On Fri, Apr 16, 2010 at 5:05 AM, victor <[email protected]> wrote: > Hi, > > I am trying to send some data via a servlet (using the examples from > this page "http://code.google.com/apis/visualization/documentation/dev/ > dsl_intro.html" ). I can send all the data formats except the datetime > ones, not sure what I am doing wrong. here is a snippet of my code > > cd.add(new ColumnDescription("Date Time", ValueType.DATE, "Date > Time")); > .... // some more columns > > .... // get the data from a DB > > DateValue date = new DateValue(2010,3,12); // Mock instead of using > true DB value > System.out.println("Date :" + date.toString()); // Seems correct get > "Date :2010-04-12" > data.addRowFromValues(date,tpid,serverTransactionId,transactionValue); > --> this lead to a an invalid type exception. > > > instead of using a date value if I use text and the date as a string > it works fine. Any pointers as to what I am doing wrong ? > > > ( i looked at the code ValueType.java from the source file in example > repository and see this bit. > > else if ((this == DATE) && (value instanceof GregorianCalendar)) { > ret = new DateValue((GregorianCalendar) value); > > thought this is causing the failure > > so tried adding this bit in my code > Object date = new DateValue(2010,3,12); > if(date instanceof GregorianCalendar) > System.out.println("Date true"); > > obviously if failed. > > Thanks, > -V > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-visualization-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
