I haven't tested it but DatePicker's getValue method returns a Date object. What I am not sure of is if the Date object reflects the current time when a user selects a date from the calendar. The returned Date's getTime() method needs to be tested to see if it does or doesn't.
Jeff On Thu, Feb 3, 2011 at 10:43 AM, Ben Imp <[email protected]> wrote: > I think you missed the bit about capturing the time portion as well. > > -Ben > > On Feb 3, 8:47 am, Jeff Schwartz <[email protected]> wrote: > > Using UiBinder in some ui.xml file: > > > > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" > > xmlns:g="urn:import:com.google.gwt.user.client.ui" > > xmlns:dp="urn:import:com.google.gwt.user.datepicker.client"> > > ... > > <table id="inputTable"> > > <tr> > > <td><g:Label addStyleNames="{style.detailLabel} > > {style.required}">Date of purchase</g:Label></td> > > <td><dp:DateBox ui:field="dopDateBox" > > styleName="{style.detailValue}"/></td> > > </tr> > > </table> > > ... > > > > Then, in the .java file: > > ... > > @UiField > > DateBox dopDateBox; > > > > ... > > dopDateBox.setFormat(new > > DateBox.DefaultFormat(DateTimeFormat.getFormat("MMMM dd, yyyy"))); > > dopDateBox.getDatePicker().setWidth("200px"); > > dopDateBox.addValueChangeHandler(new ValueChangeHandler<Date>(){ > > > > @Override > > public void onValueChange(ValueChangeEvent<Date> event) { > > ... > > } > > > > }); > > ... > > > > I hope this helps. > > > > Jeff > > > > > > > > On Thu, Feb 3, 2011 at 9:28 AM, Ben Imp <[email protected]> wrote: > > > As far as I am aware, there is no such widget. You will have to make > > > one. > > > > > -Ben > > > > > On Feb 3, 3:24 am, sujit mishra <[email protected]> wrote: > > > > Hi , > > > > > > I need help regards datetimepicke widget . I am using GWT but > not > > > > found any widget that able to capture date and time both at a > > > > time from user. > > > > > > So , please help me how to add datetimepicke using GWT > > > > > > Thanks > > > > Sujit Mishra > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to > [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<google-web-toolkit%[email protected]> > <google-web-toolkit%[email protected]<google-web-toolkit%[email protected]> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-web-toolkit?hl=en. > > > > -- > > *Jeff Schwartz* > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- *Jeff Schwartz* -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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-web-toolkit?hl=en.
