Hi,
As a pre for correct implementation of locale date formats I am looking forward to make a new javascript calendar. I have been testing dojo 0.9 and it has a nice widget (DateTextbox) for selecting dates, It is nice and fast ;) and it supports different locale formats. It should be extended however to: - Accept time input. - "Forget" about dojo locales (based upon CLDR, which I like but that's another story) and allow a date format string as parameter. These requirement should not be very difficult (I believe as I am a newbie to dojo and javascript in general). However, being the calendar one of the most visual parts of ofbiz I would like to see comments about this approach. Thanks, -- Daniel Martínez http://www.paradisosistemas.es |
There are more locale issues than just the date format string. Different locales use different
calendars. It would be best to find a way to pass a properly constructed Calendar object. -Adrian Daniel Martínez wrote: > Hi, > > As a pre for correct implementation of locale date formats I am looking > forward to make a new javascript calendar. I have been testing dojo 0.9 > and it has a nice widget (DateTextbox) for selecting dates, It is nice > and fast ;) and it supports different locale formats. It should be > extended however to: > > - Accept time input. > - "Forget" about dojo locales (based upon CLDR, which I like but that's > another story) and allow a date format string as parameter. > > These requirement should not be very difficult (I believe as I am a > newbie to dojo and javascript in general). However, being the calendar > one of the most visual parts of ofbiz I would like to see comments about > this approach. > > Thanks, > -- > Daniel Martínez > http://www.paradisosistemas.es > |
On second thought, since this is running in JavaScript, we can assume the browser will default to
the user's locale. The trick will be to figure out how to render the calendar correctly in the user's locale. Some locales have their week start on Monday, some locales have 13 months in a year, etc. Adrian Crum wrote: > There are more locale issues than just the date format string. Different > locales use different calendars. It would be best to find a way to pass > a properly constructed Calendar object. > > -Adrian > > Daniel Martínez wrote: > >> Hi, >> >> As a pre for correct implementation of locale date formats I am looking >> forward to make a new javascript calendar. I have been testing dojo 0.9 >> and it has a nice widget (DateTextbox) for selecting dates, It is nice >> and fast ;) and it supports different locale formats. It should be >> extended however to: >> >> - Accept time input. >> - "Forget" about dojo locales (based upon CLDR, which I like but that's >> another story) and allow a date format string as parameter. >> >> These requirement should not be very difficult (I believe as I am a >> newbie to dojo and javascript in general). However, being the calendar >> one of the most visual parts of ofbiz I would like to see comments about >> this approach. >> >> Thanks, >> -- >> Daniel Martínez >> http://www.paradisosistemas.es >> > |
I've been thinking about this some more...
Maybe JavaScript isn't the way to go. JavaScript doesn't have a Calendar class, so creating a calendar in JS is a nightmare. I looked through the dojo source that is included with OFBiz and there is a lot of data to maintain. Even in the dozens of dojo calendar/date related files there are problems - just look at all of the FIXME comments. I considered passing localized data to JS functions, but that has problems too. For example, what do you do if there are quote characters in translated text? Those could be escaped I guess, but then the code starts becoming complicated. Maybe it would be better to have a regular HTML Calendar that pops up in its own window. That would require server requests, but the upside is we can use bsh, ftl, java.util.Calendar, and our own style sheet to style it. The name of the HTML element that receives the date could be passed as a parameter so that the selected date could be fed back to the parent window via the JS window.opener property. What do you think? -Adrian Adrian Crum wrote: > On second thought, since this is running in JavaScript, we can assume > the browser will default to the user's locale. The trick will be to > figure out how to render the calendar correctly in the user's locale. > Some locales have their week start on Monday, some locales have 13 > months in a year, etc. > > > Adrian Crum wrote: > >> There are more locale issues than just the date format string. >> Different locales use different calendars. It would be best to find a >> way to pass a properly constructed Calendar object. >> >> -Adrian >> >> Daniel Martínez wrote: >> >>> Hi, >>> >>> As a pre for correct implementation of locale date formats I am looking >>> forward to make a new javascript calendar. I have been testing dojo 0.9 >>> and it has a nice widget (DateTextbox) for selecting dates, It is nice >>> and fast ;) and it supports different locale formats. It should be >>> extended however to: >>> >>> - Accept time input. >>> - "Forget" about dojo locales (based upon CLDR, which I like but that's >>> another story) and allow a date format string as parameter. >>> >>> These requirement should not be very difficult (I believe as I am a >>> newbie to dojo and javascript in general). However, being the calendar >>> one of the most visual parts of ofbiz I would like to see comments about >>> this approach. >>> >>> Thanks, >>> -- >>> Daniel Martínez >>> http://www.paradisosistemas.es >>> >> > |
I think that's totally reasonable and with a server round trip it makes things much more flexible, like for example being able to (in special circumstances like on group calendar screens) have something that shows available or unavailable dates for something. Anyway, right now it's in a popup window so a plan http request for that is fine, and we would just have minimal javascript to close the window and populate the field that it came from. We already have stuff in the form widget and other places for this sort of popup/lookup window. If it wasn't in a popup window, ie someone wanted a different design, the same request could be used (or a slight variation on it) in an AJAX'ed page. Getting HTML from the server in the background is a totally valid way to use AJAX. -David Adrian Crum wrote: > I've been thinking about this some more... > > Maybe JavaScript isn't the way to go. JavaScript doesn't have a Calendar > class, so creating a calendar in JS is a nightmare. > > I looked through the dojo source that is included with OFBiz and there > is a lot of data to maintain. Even in the dozens of dojo calendar/date > related files there are problems - just look at all of the FIXME comments. > > I considered passing localized data to JS functions, but that has > problems too. For example, what do you do if there are quote characters > in translated text? Those could be escaped I guess, but then the code > starts becoming complicated. > > Maybe it would be better to have a regular HTML Calendar that pops up in > its own window. That would require server requests, but the upside is we > can use bsh, ftl, java.util.Calendar, and our own style sheet to style > it. The name of the HTML element that receives the date could be passed > as a parameter so that the selected date could be fed back to the parent > window via the JS window.opener property. > > What do you think? > > -Adrian > > > Adrian Crum wrote: > >> On second thought, since this is running in JavaScript, we can assume >> the browser will default to the user's locale. The trick will be to >> figure out how to render the calendar correctly in the user's locale. >> Some locales have their week start on Monday, some locales have 13 >> months in a year, etc. >> >> >> Adrian Crum wrote: >> >>> There are more locale issues than just the date format string. >>> Different locales use different calendars. It would be best to find a >>> way to pass a properly constructed Calendar object. >>> >>> -Adrian >>> >>> Daniel Martínez wrote: >>> >>>> Hi, >>>> >>>> As a pre for correct implementation of locale date formats I am looking >>>> forward to make a new javascript calendar. I have been testing dojo 0.9 >>>> and it has a nice widget (DateTextbox) for selecting dates, It is nice >>>> and fast ;) and it supports different locale formats. It should be >>>> extended however to: >>>> >>>> - Accept time input. >>>> - "Forget" about dojo locales (based upon CLDR, which I like but that's >>>> another story) and allow a date format string as parameter. >>>> >>>> These requirement should not be very difficult (I believe as I am a >>>> newbie to dojo and javascript in general). However, being the calendar >>>> one of the most visual parts of ofbiz I would like to see comments >>>> about >>>> this approach. >>>> >>>> Thanks, >>>> -- >>>> Daniel Martínez >>>> http://www.paradisosistemas.es >>>> >>> >> |
Cool. Thank you for your comments David.
Daniel - if you create a Jira issue for this task I will help you with it. -Adrian David E Jones wrote: > > I think that's totally reasonable and with a server round trip it makes > things much more flexible, like for example being able to (in special > circumstances like on group calendar screens) have something that shows > available or unavailable dates for something. > > Anyway, right now it's in a popup window so a plan http request for that > is fine, and we would just have minimal javascript to close the window > and populate the field that it came from. We already have stuff in the > form widget and other places for this sort of popup/lookup window. > > If it wasn't in a popup window, ie someone wanted a different design, > the same request could be used (or a slight variation on it) in an > AJAX'ed page. Getting HTML from the server in the background is a > totally valid way to use AJAX. > > -David > > > Adrian Crum wrote: > >> I've been thinking about this some more... >> >> Maybe JavaScript isn't the way to go. JavaScript doesn't have a >> Calendar class, so creating a calendar in JS is a nightmare. >> >> I looked through the dojo source that is included with OFBiz and there >> is a lot of data to maintain. Even in the dozens of dojo calendar/date >> related files there are problems - just look at all of the FIXME >> comments. >> >> I considered passing localized data to JS functions, but that has >> problems too. For example, what do you do if there are quote >> characters in translated text? Those could be escaped I guess, but >> then the code starts becoming complicated. >> >> Maybe it would be better to have a regular HTML Calendar that pops up >> in its own window. That would require server requests, but the upside >> is we can use bsh, ftl, java.util.Calendar, and our own style sheet to >> style it. The name of the HTML element that receives the date could be >> passed as a parameter so that the selected date could be fed back to >> the parent window via the JS window.opener property. >> >> What do you think? >> >> -Adrian >> >> >> Adrian Crum wrote: >> >>> On second thought, since this is running in JavaScript, we can assume >>> the browser will default to the user's locale. The trick will be to >>> figure out how to render the calendar correctly in the user's locale. >>> Some locales have their week start on Monday, some locales have 13 >>> months in a year, etc. >>> >>> >>> Adrian Crum wrote: >>> >>>> There are more locale issues than just the date format string. >>>> Different locales use different calendars. It would be best to find >>>> a way to pass a properly constructed Calendar object. >>>> >>>> -Adrian >>>> >>>> Daniel Martínez wrote: >>>> >>>>> Hi, >>>>> >>>>> As a pre for correct implementation of locale date formats I am >>>>> looking >>>>> forward to make a new javascript calendar. I have been testing dojo >>>>> 0.9 >>>>> and it has a nice widget (DateTextbox) for selecting dates, It is nice >>>>> and fast ;) and it supports different locale formats. It should be >>>>> extended however to: >>>>> >>>>> - Accept time input. >>>>> - "Forget" about dojo locales (based upon CLDR, which I like but >>>>> that's >>>>> another story) and allow a date format string as parameter. >>>>> >>>>> These requirement should not be very difficult (I believe as I am a >>>>> newbie to dojo and javascript in general). However, being the calendar >>>>> one of the most visual parts of ofbiz I would like to see comments >>>>> about >>>>> this approach. >>>>> >>>>> Thanks, >>>>> -- >>>>> Daniel Martínez >>>>> http://www.paradisosistemas.es >>>>> >>>> >>> > |
In reply to this post by David E Jones
We'll need to get OFBIZ-1170 (https://issues.apache.org/jira/browse/OFBIZ-1170) committed prior to
introducing an HTML popup calendar. I'm not trying to pressure anyone, I'm just letting everyone know in advance that it will be a blocker. -Adrian David E Jones wrote: > > I think that's totally reasonable and with a server round trip it makes > things much more flexible, like for example being able to (in special > circumstances like on group calendar screens) have something that shows > available or unavailable dates for something. > > Anyway, right now it's in a popup window so a plan http request for that > is fine, and we would just have minimal javascript to close the window > and populate the field that it came from. We already have stuff in the > form widget and other places for this sort of popup/lookup window. > > If it wasn't in a popup window, ie someone wanted a different design, > the same request could be used (or a slight variation on it) in an > AJAX'ed page. Getting HTML from the server in the background is a > totally valid way to use AJAX. > > -David > > > Adrian Crum wrote: > >> I've been thinking about this some more... >> >> Maybe JavaScript isn't the way to go. JavaScript doesn't have a >> Calendar class, so creating a calendar in JS is a nightmare. >> >> I looked through the dojo source that is included with OFBiz and there >> is a lot of data to maintain. Even in the dozens of dojo calendar/date >> related files there are problems - just look at all of the FIXME >> comments. >> >> I considered passing localized data to JS functions, but that has >> problems too. For example, what do you do if there are quote >> characters in translated text? Those could be escaped I guess, but >> then the code starts becoming complicated. >> >> Maybe it would be better to have a regular HTML Calendar that pops up >> in its own window. That would require server requests, but the upside >> is we can use bsh, ftl, java.util.Calendar, and our own style sheet to >> style it. The name of the HTML element that receives the date could be >> passed as a parameter so that the selected date could be fed back to >> the parent window via the JS window.opener property. >> >> What do you think? >> >> -Adrian >> >> >> Adrian Crum wrote: >> >>> On second thought, since this is running in JavaScript, we can assume >>> the browser will default to the user's locale. The trick will be to >>> figure out how to render the calendar correctly in the user's locale. >>> Some locales have their week start on Monday, some locales have 13 >>> months in a year, etc. >>> >>> >>> Adrian Crum wrote: >>> >>>> There are more locale issues than just the date format string. >>>> Different locales use different calendars. It would be best to find >>>> a way to pass a properly constructed Calendar object. >>>> >>>> -Adrian >>>> >>>> Daniel Martínez wrote: >>>> >>>>> Hi, >>>>> >>>>> As a pre for correct implementation of locale date formats I am >>>>> looking >>>>> forward to make a new javascript calendar. I have been testing dojo >>>>> 0.9 >>>>> and it has a nice widget (DateTextbox) for selecting dates, It is nice >>>>> and fast ;) and it supports different locale formats. It should be >>>>> extended however to: >>>>> >>>>> - Accept time input. >>>>> - "Forget" about dojo locales (based upon CLDR, which I like but >>>>> that's >>>>> another story) and allow a date format string as parameter. >>>>> >>>>> These requirement should not be very difficult (I believe as I am a >>>>> newbie to dojo and javascript in general). However, being the calendar >>>>> one of the most visual parts of ofbiz I would like to see comments >>>>> about >>>>> this approach. >>>>> >>>>> Thanks, >>>>> -- >>>>> Daniel Martínez >>>>> http://www.paradisosistemas.es >>>>> >>>> >>> > |
In reply to this post by Adrian Crum
Adrian,
ofbiz dojo is outdated (and AFAIK not used at all...) I have been testing with the beta version of the new 0.9 dojo release (I just did not like 0.4 version). Calendar in dojo 0.9 is fully localized based on data from the CLDR and is also stylable through css. Anyway, being a beta and the differences in locales between dojo and ofbiz I think your solution is the best way to go right now. This solution will not be faster as Jacques wanted, though ... I will post when I create the issue. Thanks, -- Daniel Adrian Crum escribió: > I've been thinking about this some more... > > Maybe JavaScript isn't the way to go. JavaScript doesn't have a > Calendar class, so creating a calendar in JS is a nightmare. > > I looked through the dojo source that is included with OFBiz and there > is a lot of data to maintain. Even in the dozens of dojo calendar/date > related files there are problems - just look at all of the FIXME > comments. > > I considered passing localized data to JS functions, but that has > problems too. For example, what do you do if there are quote > characters in translated text? Those could be escaped I guess, but > then the code starts becoming complicated. > > Maybe it would be better to have a regular HTML Calendar that pops up > in its own window. That would require server requests, but the upside > is we can use bsh, ftl, java.util.Calendar, and our own style sheet to > style it. The name of the HTML element that receives the date could be > passed as a parameter so that the selected date could be fed back to > the parent window via the JS window.opener property. > > What do you think? > > -Adrian > > > Adrian Crum wrote: > >> On second thought, since this is running in JavaScript, we can assume >> the browser will default to the user's locale. The trick will be to >> figure out how to render the calendar correctly in the user's locale. >> Some locales have their week start on Monday, some locales have 13 >> months in a year, etc. >> >> >> Adrian Crum wrote: >> >>> There are more locale issues than just the date format string. >>> Different locales use different calendars. It would be best to find >>> a way to pass a properly constructed Calendar object. >>> >>> -Adrian >>> >>> Daniel Martínez wrote: >>> >>>> Hi, >>>> >>>> As a pre for correct implementation of locale date formats I am >>>> looking >>>> forward to make a new javascript calendar. I have been testing dojo >>>> 0.9 >>>> and it has a nice widget (DateTextbox) for selecting dates, It is nice >>>> and fast ;) and it supports different locale formats. It should be >>>> extended however to: >>>> >>>> - Accept time input. >>>> - "Forget" about dojo locales (based upon CLDR, which I like but >>>> that's >>>> another story) and allow a date format string as parameter. >>>> >>>> These requirement should not be very difficult (I believe as I am a >>>> newbie to dojo and javascript in general). However, being the calendar >>>> one of the most visual parts of ofbiz I would like to see comments >>>> about >>>> this approach. >>>> >>>> Thanks, >>>> -- >>>> Daniel Martínez >>>> http://www.paradisosistemas.es >>>> >>> >> -- ------------------------------------------------------------------------ Soluciones de Gestión para su empresa eBusiness, ERP, CRM ------------------------------------------------------------------------ *Daniel Martínez Martínez* * * Gerente C/ Julia García Boután, 29 D 3ºB 28022 Madrid España * * E-mail: [hidden email] <mailto:[hidden email]> Web: *www.paradisosistemas.es <http://www.paradisosistemas.es> *Comercial: [hidden email] <mailto:[hidden email]> Tel: 678416758 |
Administrator
|
Daniel, All interested,
Thanks for your investigations. I guess this will be a next step (using Dojo or another library it one proves better regarding calendar stuffes). Really needed if we want to compete in this area. Calendars are important and sometimes heavily used things, waiting for a popup ist not reasonable IMHO... Jacques ----- Message d'origine ----- De : "Daniel Martínez" <[hidden email]> À : <[hidden email]> Envoyé : vendredi 27 juillet 2007 10:34 Objet : Re: New javascript calendar (dojo) > Adrian, > > ofbiz dojo is outdated (and AFAIK not used at all...) I have been > testing with the beta version of the new 0.9 dojo release (I just did > not like 0.4 version). Calendar in dojo 0.9 is fully localized based on > data from the CLDR and is also stylable through css. Anyway, being a > beta and the differences in locales between dojo and ofbiz I think your > solution is the best way to go right now. This solution will not be > faster as Jacques wanted, though ... > > I will post when I create the issue. > > Thanks, > -- > Daniel > > Adrian Crum escribió: > > I've been thinking about this some more... > > > > Maybe JavaScript isn't the way to go. JavaScript doesn't have a > > Calendar class, so creating a calendar in JS is a nightmare. > > > > I looked through the dojo source that is included with OFBiz and there > > is a lot of data to maintain. Even in the dozens of dojo calendar/date > > related files there are problems - just look at all of the FIXME > > comments. > > > > I considered passing localized data to JS functions, but that has > > problems too. For example, what do you do if there are quote > > characters in translated text? Those could be escaped I guess, but > > then the code starts becoming complicated. > > > > Maybe it would be better to have a regular HTML Calendar that pops up > > in its own window. That would require server requests, but the upside > > is we can use bsh, ftl, java.util.Calendar, and our own style sheet to > > style it. The name of the HTML element that receives the date could be > > passed as a parameter so that the selected date could be fed back to > > the parent window via the JS window.opener property. > > > > What do you think? > > > > -Adrian > > > > > > Adrian Crum wrote: > > > >> On second thought, since this is running in JavaScript, we can assume > >> the browser will default to the user's locale. The trick will be to > >> figure out how to render the calendar correctly in the user's locale. > >> Some locales have their week start on Monday, some locales have 13 > >> months in a year, etc. > >> > >> > >> Adrian Crum wrote: > >> > >>> There are more locale issues than just the date format string. > >>> Different locales use different calendars. It would be best to find > >>> a way to pass a properly constructed Calendar object. > >>> > >>> -Adrian > >>> > >>> Daniel Martínez wrote: > >>> > >>>> Hi, > >>>> > >>>> As a pre for correct implementation of locale date formats I am > >>>> looking > >>>> forward to make a new javascript calendar. I have been testing dojo > >>>> 0.9 > >>>> and it has a nice widget (DateTextbox) for selecting dates, It is nice > >>>> and fast ;) and it supports different locale formats. It should be > >>>> extended however to: > >>>> > >>>> - Accept time input. > >>>> - "Forget" about dojo locales (based upon CLDR, which I like but > >>>> that's > >>>> another story) and allow a date format string as parameter. > >>>> > >>>> These requirement should not be very difficult (I believe as I am a > >>>> newbie to dojo and javascript in general). However, being the calendar > >>>> one of the most visual parts of ofbiz I would like to see comments > >>>> about > >>>> this approach. > >>>> > >>>> Thanks, > >>>> -- > >>>> Daniel Martínez > >>>> http://www.paradisosistemas.es > >>>> > >>> > >> > > -- > ------------------------------------------------------------------------ > Soluciones de Gestión para su empresa > eBusiness, ERP, CRM > ------------------------------------------------------------------------ > *Daniel Martínez Martínez* > * * > Gerente > C/ Julia García Boután, 29 D 3ºB > 28022 Madrid > España * * > E-mail: [hidden email] > <mailto:[hidden email]> > Web: *www.paradisosistemas.es <http://www.paradisosistemas.es> > *Comercial: [hidden email] <mailto:[hidden email]> > Tel: 678416758 > |
In reply to this post by Daniel Martínez-4
Daniel,
I'm not against using dojo. I like the idea of using Java's Calendar class because that makes the localization details Sun's problem, not ours or dojo's. Sun has a good handle on internationalization, so using the Java classes for calendars almost guarantees that they will work nearly anywhere in the world. The HTML version should be fairly quick, since no data is being retrieved or anything. The HTML calendar implementation will be trivial - just use the user's locale and time zone to construct a Calendar object, and then pass that object to a Freemarker template that uses it to iterate through the dates. I will be available to help work on it this weekend. I can't imagine it taking more than a day. -Adrian Daniel Martínez wrote: > Adrian, > > ofbiz dojo is outdated (and AFAIK not used at all...) I have been > testing with the beta version of the new 0.9 dojo release (I just did > not like 0.4 version). Calendar in dojo 0.9 is fully localized based on > data from the CLDR and is also stylable through css. Anyway, being a > beta and the differences in locales between dojo and ofbiz I think your > solution is the best way to go right now. This solution will not be > faster as Jacques wanted, though ... > > I will post when I create the issue. > > Thanks, > -- > Daniel > > Adrian Crum escribió: > >>I've been thinking about this some more... >> >>Maybe JavaScript isn't the way to go. JavaScript doesn't have a >>Calendar class, so creating a calendar in JS is a nightmare. >> >>I looked through the dojo source that is included with OFBiz and there >>is a lot of data to maintain. Even in the dozens of dojo calendar/date >>related files there are problems - just look at all of the FIXME >>comments. >> >>I considered passing localized data to JS functions, but that has >>problems too. For example, what do you do if there are quote >>characters in translated text? Those could be escaped I guess, but >>then the code starts becoming complicated. >> >>Maybe it would be better to have a regular HTML Calendar that pops up >>in its own window. That would require server requests, but the upside >>is we can use bsh, ftl, java.util.Calendar, and our own style sheet to >>style it. The name of the HTML element that receives the date could be >>passed as a parameter so that the selected date could be fed back to >>the parent window via the JS window.opener property. >> >>What do you think? >> >>-Adrian >> >> >>Adrian Crum wrote: >> >> >>>On second thought, since this is running in JavaScript, we can assume >>>the browser will default to the user's locale. The trick will be to >>>figure out how to render the calendar correctly in the user's locale. >>>Some locales have their week start on Monday, some locales have 13 >>>months in a year, etc. >>> >>> >>>Adrian Crum wrote: >>> >>> >>>>There are more locale issues than just the date format string. >>>>Different locales use different calendars. It would be best to find >>>>a way to pass a properly constructed Calendar object. >>>> >>>>-Adrian >>>> >>>>Daniel Martínez wrote: >>>> >>>> >>>>>Hi, >>>>> >>>>>As a pre for correct implementation of locale date formats I am >>>>>looking >>>>>forward to make a new javascript calendar. I have been testing dojo >>>>>0.9 >>>>>and it has a nice widget (DateTextbox) for selecting dates, It is nice >>>>>and fast ;) and it supports different locale formats. It should be >>>>>extended however to: >>>>> >>>>>- Accept time input. >>>>>- "Forget" about dojo locales (based upon CLDR, which I like but >>>>>that's >>>>>another story) and allow a date format string as parameter. >>>>> >>>>>These requirement should not be very difficult (I believe as I am a >>>>>newbie to dojo and javascript in general). However, being the calendar >>>>>one of the most visual parts of ofbiz I would like to see comments >>>>>about >>>>>this approach. >>>>> >>>>>Thanks, >>>>>-- >>>>>Daniel Martínez >>>>>http://www.paradisosistemas.es >>>>> >>>> > |
Free forum by Nabble | Edit this page |