Gareth Evans wrote:
> To get around the concerns of having to specify the locale why don't we
> specify a date-format string which has a number of replaces performed on it.
> That way, you can just specify the return format, aside from the locale.
> If the users application wants * as a seperator, then they can specify it.
>
> For example (this is psudeocode / half vb [for the date stuff] half js
> [for the prototype stuff])
> I may have used hash incorrectly, but you should get the drift
>
> placeholders_hash -> { 'MM': month(currentDate), 'YYYY':
> year(currentdate), 'YY': substr(year(currentdate),2), 'D':
> day(currentdate) }
> formatString = 'D/MM/YYYY'
> var outputString = formatString;
> placeholders_hash.each(function (key,value) {
> outputString = replace(outputString,key,value) });
> alert(outputString);
>
> Then by changing formatString, you can control the order, the parts
> used, the seperator etc.
> You could make it iso compliant by passing YYYY-MM-DD (assuming all of
> those placeholders were in the hash)
>
> Just an idea...
Hi Gareth,
ok, I'll will work on this type of approach to give more power to the
user for formatting the date, thanks for the input.
In the meantime I just released an minor update to the initial release
v0.9.1 :
http://www.eulerian.com/en/opensource/datepicker-prototype-scriptaculous
Here is the ChangeLog :
- replace locale by language (RobG)
- add support for german language (Kjell Bublitz)
- add support for portuguese language
- use Prototype.emptyFunction when clickCallBack not defined, should
fix possible bug with IE and null objects (Gareth Evans)
- some code clean-up using Builder.node
Regards,
Mathieu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---