[dojo-contributors] How to construct Date object from string?

Jon Sykes jon.sykes at media-hive.com
Thu Jun 29 14:19:38 EDT 2006


Adam Peller said a while ago:

> IBM has such a library that's part of the JWL toolkit that  
> currently ships
> with Rational Application Developer, and it's being donated to  
> Dojo, just
> as soon as we get the CLA signed (any day now, really :-)
>
> The library deals with Numbers, Dates, Times, Currencies
> of the variety that Jon mentions in his e-mail (we've got tables of  
> this
> information for about 70 locales) and several types of calendars.
> There's other code there as well that we'll be making available, such
> as a data layer, though integrating that with Dojo may not be as
> straightforward.
>
> I've also been prototyping some code to do loading of resource bundles
> based on locale, like the JDK, but using the same mechanism as  
> dojo.require()
> As soon as I can, I'll share and ask for feedback.

That sounds like it would be ideal for this.

Jon Sykes


On Jun 29, 2006, at 2:15 PM, Kun Xi wrote:

> Hi all,
>
> I checked the Ticket #1008, "dropdowndatepicker can't handle other
> date formats" in the trac, and find the problem is caused by
> DropdownDatePicker.js, Ln 47:
>
> 		onInputChange: function(){
> Ln:47		var tmp = new Date(this.inputNode.value);
> 			this.datePicker.date = tmp;
> 			this.datePicker.setDate(dojo.widget.DatePicker.util.toRfcDate 
> (tmp));
> 			this.datePicker.initData();
> 			this.datePicker.initUI();
> 		}
> Here, the tmp is constructed from the input field regardless the input
> format, it is might be easier to fix this bug, if the following
> function is supported:
>
> var tmp = new Date( this.inputNode.value, this.dateFormat );
>
> Any idea to construct a Date object based upon input and format ?
>
> Best regards,
> Kun Xi
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>




More information about the dojo-contributors mailing list