The attached email is the motivation for this appeal.

Developers - please keep in mind that OFBiz operates in multiple languages, 
time zones, currencies, and calendars. We can't assume anything in those 
regards.

If you are going to work on any of those issues (time, date, currency, 
language) make sure you understand what you are doing.

IBM has been doing this (internationalization) for decades and they have a Java 
library for it - ICU (http://site.icu-project.org). Parts of the library are in 
use in OFBiz, but the main point is to understand the differences in cultures, 
calendars, currencies, etc. The IBM ICU library is a good guide to enlighten 
you in internationalization.

If you are a contributor or a committer, please spend some time to learn about 
internationalization. Doing so will keep OFBiz on the forefront of global ERP.

-Adrian


--- On Tue, 8/4/09, Adrian Crum <[email protected]> wrote:

> From: Adrian Crum <[email protected]>
> Subject: Re: svn commit: r801024 - 
> /ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
> To: [email protected]
> Date: Tuesday, August 4, 2009, 7:30 PM
> 
> A good demo of the bug before the online demo is updated:
> 
> Using the online demo, go to the work effort month view
> calendar. Click Next Month until you reach October. Notice
> the last week. Switch the locale to French and look at the
> last week again.
> 
> -Adrian
> 
> 
> --- On Tue, 8/4/09, Hans Bakker <[email protected]>
> wrote:
> 
> > From: Hans Bakker <[email protected]>
> > Subject: Re: svn commit: r801024 -
> /ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
> > To: [email protected]
> > Date: Tuesday, August 4, 2009, 6:35 PM
> > Thank you for your help Adrian.
> > 
> > On Tue, 2009-08-04 at 23:40 +0000, [email protected]
> > wrote:
> > > Author: adrianc
> > > Date: Tue Aug  4 23:40:00 2009
> > > New Revision: 801024
> > > 
> > > URL: http://svn.apache.org/viewvc?rev=801024&view=rev
> > > Log:
> > > Fixed a bug in the Month view work effort
> calendar.
> > > 
> > > Modified:
> > > 
> >
>    ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
> > > 
> > > Modified:
> >
> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
> > > URL: 
> > > http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy?rev=801024&r1=801023&r2=801024&view=diff
> > >
> >
> ==============================================================================
> > > ---
> >
> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
> > (original)
> > > +++
> >
> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
> > Tue Aug  4 23:40:00 2009
> > > @@ -51,24 +51,30 @@
> > >  context.prevMillis = new
> > Long(prev.getTime()).toString();
> > >  next = UtilDateTime.getDayStart(start,
> > numDays+1, timeZone, locale);
> > >  context.nextMillis = new
> > Long(next.getTime()).toString();
> > > -end = UtilDateTime.getDayStart(start, numDays,
> > timeZone, locale);
> > > +end = UtilDateTime.getMonthEnd(start, timeZone,
> > locale);
> > >  
> > >  //Find out what date to get from
> > >  getFrom = null;
> > >  prevMonthDays = 
> > tempCal.get(Calendar.DAY_OF_WEEK) -
> > tempCal.getFirstDayOfWeek();
> > > -if (prevMonthDays < 0) prevMonthDays = 7 +
> > prevMonthDays;
> > > -tempCal.add(Calendar.DATE,-(prevMonthDays));
> > > +if (prevMonthDays < 0) prevMonthDays += 7;
> > > +tempCal.add(Calendar.DATE, -prevMonthDays);
> > >  numDays += prevMonthDays;
> > >  getFrom = new
> > Timestamp(tempCal.getTimeInMillis());
> > >  firstWeekNum =
> > tempCal.get(Calendar.WEEK_OF_YEAR);
> > >  context.put("firstWeekNum", new
> > Integer(firstWeekNum));
> > >  
> > >  // also get days until the end of the week at
> > the end of the month
> > > -lastWeekCal =
> >
> UtilDateTime.toCalendar(UtilDateTime.addDaysToTimestamp(start,
> > numDays - prevMonthDays), timeZone, locale);
> > > -followingMonthDays = 7 +
> > lastWeekCal.getFirstDayOfWeek() -
> > lastWeekCal.get(Calendar.DAY_OF_WEEK);
> > > -if (followingMonthDays < 7) numDays +=
> > followingMonthDays; 
> > > +lastWeekCal = UtilDateTime.toCalendar(end,
> timeZone,
> > locale);
> > > +monthEndDay =
> lastWeekCal.get(Calendar.DAY_OF_WEEK);
> > > +getTo = UtilDateTime.getWeekEnd(end, timeZone,
> > locale);
> > > +lastWeekCal = UtilDateTime.toCalendar(getTo,
> > timeZone, locale);
> > > +followingMonthDays =
> > lastWeekCal.get(Calendar.DAY_OF_WEEK) - monthEndDay;
> > > +if (followingMonthDays < 0) {
> > > +    followingMonthDays += 7;
> > > +}
> > > +numDays += followingMonthDays; 
> > >  
> > > -serviceCtx = UtilMisc.toMap("userLogin",
> userLogin,
> > "start", getFrom,"numPeriods", new Integer(numDays),
> > "periodType", new Integer(Calendar.DATE));
> > > +serviceCtx = UtilMisc.toMap("userLogin",
> userLogin,
> > "start", getFrom, "numPeriods", new Integer(numDays),
> > "periodType", new Integer(Calendar.DATE));
> > >  serviceCtx.putAll(UtilMisc.toMap("partyId",
> > partyId, "facilityId", facilityId, "fixedAssetId",
> > fixedAssetId, "workEffortTypeId", workEffortTypeId,
> > "locale", locale, "timeZone", timeZone));
> > >  if (entityExprList) {
> > >     
> > serviceCtx.putAll(["entityExprList" :
> entityExprList]);
> > > 
> > > 
> > -- 
> > Antwebsystems.com: Quality OFBiz services for
> competitive
> > rates
> > 
> > 
> 
> 
> 
> 



Reply via email to