You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2006/11/11 16:09:38 UTC

[jira] Commented: (OFBIZ-2) Add Timezone versions of functions in UtilDateTime

    [ http://issues.apache.org/jira/browse/OFBIZ-2?page=comments#action_12448983 ] 
            
Jacques Le Roux commented on OFBIZ-2:
-------------------------------------

The function "weekNumber" in the UtilDateTime.java has been updated some times ago.  This patch is in the same spirit (actually it's the 1st in time) and I can't see anything dangerous in it, what are we waiting for commiting it ?

I found this issue by chance looking for a change I have in  applications/order/src/org/ofbiz/order/order/OrderServices.java using getDayStar and I can't remember where it comes :

Index: applications/order/src/org/ofbiz/order/order/OrderServices.java
===================================================================
--- applications/order/src/org/ofbiz/order/order/OrderServices.java     (révision 473700)
+++ applications/order/src/org/ofbiz/order/order/OrderServices.java     (copie de travail)
@@ -631,8 +631,9 @@
                 while (--dayCount >= 0)    {
                     GenericValue techDataCalendarExcDay = null;
                     // find an existing Day exception record
-                    Timestamp exceptionDateStartTime = new Timestamp((long)(estimatedStartDate.getTime() + (dayCount * 86400000)));
-                    try {     techDataCalendarExcDay = delegator.findByPrimaryKey("TechDataCalendarExcDay",
+                    Timestamp exceptionDateStartTime = UtilDateTime.getDayStart(new Timestamp(estimatedStartDate.getTime()),(int)dayCount);
+                    try {
+                        techDataCalendarExcDay = delegator.findByPrimaryKey("TechDataCalendarExcDay",
                             UtilMisc.toMap("calendarId", fixedAsset.get("calendarId"), "exceptionDateStartTime", exceptionDateStartTime));
                     }
                     catch (GenericEntityException e) {

I think I will commit this hunk shortly and why not the patch of this issue ? 

Please advices/opinions are needed...

Thanks


> Add Timezone versions of functions in UtilDateTime
> --------------------------------------------------
>
>                 Key: OFBIZ-2
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-2
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Vinay Agarwal
>         Attachments: 06-06-21 Timezone.patch
>
>
> I am starting to work with timezones. The first thing I came across is UtilDateTime's functions completely ignore timezones. I plan to create timezone versions of functions like getDayStart that will take a timezone id string or a TimeZone. I would not use any deprecated functions but do not plan to change their use in existing functions. I would appreciate suggestions.
> Regards,
> Vinay Agarwal

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira