about calendar.js, I found in http://docs.jquery.com/Plugins/Calendar
that it has renamed to http://docs.jquery.com/UI/Datepicker. Datepicker suports localization: ------------------------------------------------------------------------------------------------------------------------------ Localization Datepicker provides support for localizing its content to cater for different languages and date formats. Each localization is contained within its own file with the language code appended to the name, e.g. jquery.ui.datepicker-fr.js for French. These files are loaded after the main datepicker code. They add their settings to the set of available localizations and automatically apply them as defaults for all instances. The $.datepicker.regional attribute holds an array of localizations, indexed by language code, with '' referring to the default (English). Each entry is an object with the following attributes: closeText, prevText, nextText, currentText, monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, weekHeader, dateFormat, firstDay, isRTL, showMonthAfterYear, and yearSuffix. You can restore the default localizations with: $.datepicker.setDefaults($.datepicker.regional['']); And can then override an individual datepicker for a specific locale: $(selector).datepicker($.datepicker.regional['fr']); The localization files are also available in the UI svn: http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/ --------------------------------------------------------- Massimo, can you think about replace the calendar class in web2py? or, If I am wrong, where find the docs about the calendar.js? 2009/12/24 mdipierro <[email protected]> > the IS_DATE and IS_DATETIME accept a format argument. You should set > it explicitly > > db.table.field.requires=IS_DATE(format=T('%Y-%M-%D')) > > then use the translation interface to translate both the string above > and the calendar.js translation string. > > Massimo > > On Dec 23, 8:24 pm, Brian M <[email protected]> wrote: > > Mengu's right. While changing the format in web2py_ajax would make the > > chosen date display in the format you wanted, upon submission the form > > will be rejected because web2py wants only yyyy-mm-dd format. So if > > you go that route you'd have to do some form processing yourself to > > convert formats and probably not use SQLFORM. > > > > Perhaps you could add an extra field that would be updated every time > > the chosen date changed and have that field be in the correct format? > > I know that jQuery UI's datepicker has an altField option built-in, > > but I don't think the DynarchCalendar that web2py uses does. Maybe you > > could create a widget that would use the jQuery UI calendar instead? > > > > ~Brian > > > > On Dec 23, 6:54 pm, Mengu <[email protected]> wrote: > > > > > And note that yyyy-mm-dd format is the way how mysql and sqlite keep > > > dates. > > > > > On Dec 23, 4:39 pm, Brian M <[email protected]> wrote: > > > > > > I think that the format is controlled in the web2py_ajax.html view. > > > > > > try {jQuery("input.date").focus( function() {Calendar.setup({ > > > > inputField:this.id, ifFormat:"{{=T('%Y-%m-%d')}}", > > > > showsTime:false > > > > }); }); } catch(e) {}; > > > > try { jQuery("input.datetime").focus( function() {Calendar.setup({ > > > > inputField:this.id, ifFormat:"{{=T('%Y-%m-%d %H:%M:%S')}}", > > > > showsTime: true,timeFormat: "24" > > > > }); }); } catch(e) {}; > > > > > > Since the format string seems to be in a T() I would guess that it's > > > > possible to change that using translations? > > > > > > ~Brian > > > > > > On Dec 23, 7:29 am, Alexandre Andrade <[email protected]> > > > > wrote: > > > > > > > While > > > > > > > db.convenio.data_assinatura.requires = > > > > > IS_DATE(format=T('%d-%m-%Y'),error_message=T('deve ser no formato > > > > > DD-MM-AAAA!')) > > > > > > > show me the date in correct locale, the calendar widget don't show > the > > > > > correct date. > > > > > > > How to locale it or make it show the correct date? > > > > > > > -- > > > > > Atenciosamente > > > > > > > -- > > > > > ========================= > > > > > Alexandre Andrade > > > > > Hipercenter.com > > > > > > -- > > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<web2py%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en. > > > --------------- -- Atenciosamente -- ========================= Alexandre Andrade Hipercenter.com -- You received this message because you are subscribed to the Google Groups "web2py-users" 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/web2py?hl=en.

