[OpenAjaxIDE] Agenda for tomorrow: Review Widget Metadata chapter

Bertrand Le Roy Bertrand.Le.Roy at microsoft.com
Mon Aug 10 21:05:34 PDT 2009


To add to that, the second hard part is to handle those cultures where the calendar is non-Gregorian.

For those cultural tables, it is indeed a lot of work if you have to do them from scratch, but fortunately the job has already been done by all the major class libraries out there. For example, our own JavaScript files are generated from the data in the .NET framework. I suppose Dojo does the same kind of trick from the Java class library.

From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On Behalf Of Adam Peller
Sent: Monday, August 10, 2009 7:35 PM
To: Jon Ferraiolo
Cc: ide-bounces at openajax.org; ide at openajax.org
Subject: Re: [OpenAjaxIDE] Agenda for tomorrow: Review Widget Metadata chapter


So the dojox date routines are largely experimental and not well-internationalized. The DojoX stuff was contributed by someone who simply had to have PHP and Posix notations, and the other stuff in there is for non-Gregorian calendars -- let's not go there! ;-)

Dojo's supported date routines, FWIW, are in dojo.date, and follow the Java DateFormat convention mostly so that they can leverage the Unicode CLDR table, which has the kind of localization data Bertrand mentions -- a complete table for literally hundreds of locales and languages. The developer typically would not want to provide a format string at all, since it would defeat localization. Instead, the request would usually be to format a Date object using "short", "medium" or "long" formats for a particular locale.

It's complicated to do a complete job at Date i18n. The logic to format according to date strings isn't that bad (Steve Souders has a nice library for this also, fwiw) The hardest part is those data tables, which seem to require a lot of maintenance, and a scheme for selecting and packaging the right one. Doing just a little i18n or hard-coding a few locales, as most JS Date utilities do, doesn't seem like a worthwhile solution IMO. It would also be a shame to duplicate a function that is likely going to be reimplemented by a library somewhere else on the page. Any chance this is something we can avoid or defer to toolkits or server environments with a more generic formatting function?

-Adam


[Inactive hide details for Jon Ferraiolo---08/04/2009 03:15:16 PM---Two questions:]Jon Ferraiolo---08/04/2009 03:15:16 PM---Two questions:
Jon Ferraiolo/Menlo Park/IBM at IBMUS
Sent by: ide-bounces at openajax.org

08/04/2009 03:12 PM


To


"Steve Repetti" <steve at radwebtech.com>


cc


ide-bounces at openajax.org, ide at openajax.org


Subject


Re: [OpenAjaxIDE] Agenda for tomorrow: Review Widget Metadata chapter








Two questions:

* Internationalization: Aren't there complexities with date formatting having to do with the current locale? The dojox logic includes several files having to do with internationalization, including a few Hebrew*.js and IslamicDate.js (545 lines of JS).

* Code size: Does anyone have is a guesstimate about how many lines of JavaScript code would be needed to implement @@dataformat()@@. Steve's features appear to be a subset of the PHP features. Our open source widget loader is 1760 lines of JavaScript. The dojox file that implements PHP's date features is 308 lines, but when you add in the Hebrew and Islamic stuff, the dojox date routines will be roughly the same size as the rest of the widget loader.

Jon



[Inactive hide details for "Steve Repetti" ---08/04/2009 11:29:30 AM---I have written an xDate JavaScript class which does a ton]"Steve Repetti" ---08/04/2009 11:29:30 AM---I have written an xDate JavaScript class which does a ton of date formatting, and includes an extern

From:


"Steve Repetti" <steve at radwebtech.com>


To:


"'Kin Blas'" <jblas at adobe.com>, <ide at openajax.org>


Date:


08/04/2009 11:29 AM


Subject:


Re: [OpenAjaxIDE] Agenda for tomorrow: Review Widget Metadata chapter


Sent by:


ide-bounces at openajax.org

________________________________



I have written an xDate JavaScript class which does a ton of date formatting, and includes an externalized function dateFormat( dte, fstr ):

// Supported formats:

// mm = month as "1" dd = day as "1" YY = day as "01"
// MM = month as "01" DD = day as "01" YYYY = day as "2001"
// MMM = month as "Jan" DDD = day as "1st"
// MMMM = month as "January" DDDD = day as "Saturday"

// time:
// hh = hour as "05" (12-hour clock) MN = minutes as "01" ap = am/pm as "am"
// HH = hour as "17" (24-hour clock) SS = seconds as "01" AP = am/pm as "AM"
// SSSS = milliseconds as "0001"

As in: dateFormat( null, “The date is MMMM, DD, YYYY and the time is HH:MN:SS” )


I would be more than happy to donate it to the cause if anyone wants (I wrote it as part of my www.xwinlib.com<http://www.xwinlib.com/> library).

Let me know,

Steve Repetti
www.radwebtech.com<http://www.radwebtech.com/>
www.scrapplet.com<http://www.scrapplet.com/>



From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On Behalf Of Kin Blas
Sent: Tuesday, August 04, 2009 1:52 PM
To: ide at openajax.org
Subject: Re: [OpenAjaxIDE] Agenda for tomorrow: Review Widget Metadata chapter

Unfortunately, I won’t be able to make the meeting today due to a last-minute internal conflict which I can’t get out of. I will also be on PTO Wednesday through next Tuesday so I won’t be available via email.

I have not had a chance to link up with Lori, but what I did have in mind was something similar to the PHP or Unix style date formatting where variable substitutions are made:

<p>Euro-Style: @@formatdate(myDate,”d/m/Y”)@@</p>
<p>Western Style: @@formatdate(myDate,”m/d/Y”)@@</p>

This would be the most flexible as opposed to having built-in canned formatted dates. Of course this would mean we would have to adopt the PHP/Unix variables (desireable), or come up with our own (less-desireable).

--== Kin ==--

From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On Behalf Of Jon Ferraiolo
Sent: Monday, August 03, 2009 11:35 AM
To: ide at openajax.org
Subject: [OpenAjaxIDE] Agenda for tomorrow: Review Widget Metadata chapter

The main topic for tomorrow's phone call is detailed review of the Widget Metadata chapter:

* http://www.openajax.org/member/wiki/OpenAjax_Metadata_1.0_Specification_Widget_Metadata

Kin and Lori were also going to look into a proposal for a date formatting function. Regarding that topic, I did some web searches. It appears that ExtJS and Dojo (in dojox: http://api.dojotoolkit.org/jsdoc/1.3/dojox.date.php.DateFormat) have both offered JavaScript APIs that implement a subset of PHP's date formatting features. Also, the ServerJS crowd are talking about offering a date formatting feature that is also derivative of PHP's date formatting features. (http://www.mynajs.org/shared/docs/js/libOO/files/Date-js.html) Adam has been making comments to the ServerJS crowd that they should focus on core features and treat date formatting as something that can be provided by an add-on JavaScript library.

Thanks to Lori for the editorial work on the cover page and chapters 1 and 2._______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide_______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090811/52fd81ef/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 105 bytes
Desc: image001.gif
Url : http://openajax.org/pipermail/ide/attachments/20090811/52fd81ef/attachment-0001.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 168 bytes
Desc: image003.png
Url : http://openajax.org/pipermail/ide/attachments/20090811/52fd81ef/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 166 bytes
Desc: image004.png
Url : http://openajax.org/pipermail/ide/attachments/20090811/52fd81ef/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 168 bytes
Desc: image005.png
Url : http://openajax.org/pipermail/ide/attachments/20090811/52fd81ef/attachment-0005.png 


More information about the IDE mailing list