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...
Gareth
On 3/12/07, Deco Rior <[EMAIL PROTECTED]> wrote:
>
> A few items:
>
> Personally, I think there are two concerns
>
> The value shown to the user:
>
> This should be the localized value
>
> And the ISO value commonly:
>
> YYYY-MM-DD
>
> We have tried using the ISO value for our customers, but they really
> don't like it. But it makes sense to standardize the passed value.
>
> Secondly,Another calendar is spinelz.org
>
> Lastly, the biggest problem I have had with calendars is having their
> styles be independent. So many calendars are great until incorporated
> into a main page where there are css style classes.
>
> I am looking forward to trying this one!
>
> Great work.
>
> Deco
>
>
> On Mar 10, 2007, at 9:25 PM, RobG wrote:
>
> >
> >
> >
> > On Mar 11, 12:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> >> Kjell Bublitz wrote:
> >>> Cool thing :)
> >>
> >> Thanks !
> >>
> >>> You should add different Date formats based on locale aswell. Like:
> >>> 10.03.2007 or 03-10-07
> >>
> >> This is already handled, if we are in english locale the mm-dd-yyyy
> >> format is used, dd-mm-yyyy is used otherwise.
> >
> > English is not a locale, it is a language spoken in a great many
> > locales. It is not reasonable to expect that someone using English
> > will require a date format that is specific to a particular country
> > that happens to speak English.
> >
> > The ISO date standard is the place to start for international date
> > formats:
> >
> > <URL: http://www.iso.org/iso/en/prods-services/popstds/
> > datesandtime.html
> >>
> >
> >
> > --
> > Rob
> >
> >
> > >
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---