Re: [qooxdoo-devel] DateChooser value in table column
Brought to you by:
ecker,
martinwittemann
From: Qoodary <qo...@go...> - 2010-03-15 14:39:03
|
Hi Derrell, thanks a lot for your help. This works fine now. But an additional question to the DateChooser. The output with getValue or getData is always in this way: Wed Mar 31 2010 12:00:00 GMT+0200 I have read the Api for DateChooser but I cannot find any information about the values for each day. 1. why is the time always 12:00:00 ? 2. How can you format the output that you have only the month, day and year, like; 03 31 2010 ? I have only seen a function getShownMonth() and getShownYear() best regards Hansjoerg Derrell Lipman wrote: > > On Mon, Mar 15, 2010 at 10:00, Qoodary <qo...@go...> wrote: > >> >> Hello list, >> >> I want to show the selected data from the >> http://demo.qooxdoo.org/1.0.x/demobrowser/#widget~DateChooser.html<http://demo.qooxdoo.org/1.0.x/demobrowser/#widget%7EDateChooser.html> >> DateChooser into a table column. >> >> var currentDate = WinDeadline.chooser.getValue(); >> alert(currentDate); >> var rowData = []; >> rowData.push([ "", "", "", currentDate ]); >> this.tableModel.setData(rowData); >> ----------------------------------------- >> >> The Problem is: >> The alert shows the date in correct format: >> >> Tue Mar 23 2010 12:00:00 GMT+0100 >> >> but in the Table column the Date is; >> >> 3/23/10 >> >> >> I dont understand why this is shown in a different way? >> What can you do that the date is shown in the table as same as in the >> alert? >> > > If you pass around a Date object, each widget or function is free to > format > it as it sees fit. Specifically, the Table's default cell renderer formats > a > date object using the default format, as returned by > qx.util.format.DateFormat.getDateInstance().format(value). > > You can solve the problem by selecting the format (or using a default > format) when you enter the data into the table rather than allowing the > table to format it. Replace your rowData.push line with something like: > > rowData.push([ "", "", "", currentDate.toString() ]); > > You can also using the formatting routines in qx.util.format.DateFormat to > format it any way you'd like and provide the formatted string to the data > model. Alternatively, you could create a cell renderer for that column > that > formatted the date object in your preferred fashion. > > Cheers, > > Derrell > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > qooxdoo-devel mailing list > qoo...@li... > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > -- View this message in context: http://old.nabble.com/DateChooser-value-in-table-column-tp27904653p27905046.html Sent from the qooxdoo-devel mailing list archive at Nabble.com. |