[ 
https://issues.apache.org/jira/browse/OFBIZ-6870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15244166#comment-15244166
 ] 

Rahul Singh commented on OFBIZ-6870:
------------------------------------

Hi [~pfm.smits], [~jacques.le.roux],

I looked into this issue and made following findings:

When creating a new time sheet, entry field shows a week from Monday to Sunday, 
while actually created timesheet span from Sunday to Saturday(As already 
mentioned).

While searching for the root cause of it, found 'createTimesheetForThisWeek' 
method of 'TimesheetServices' is used to set week start and end date. To set 
week start, 'getWeekStart' method of 'UtilDateTime' is called which set the 
first day of the week using Calendar's API .i.e., Sunday, and rightly as also 
mentioned in 
Document(https://cwiki.apache.org/confluence/display/OFBIZ/Calendars,+Dates,+and+Times)
 made by Adrian.

*Solutions:*
If still we agree to set week start day from Monday then following line of 
getWeekStart() method from UtilDateTime,
*tempCal.set(Calendar.DAY_OF_WEEK, tempCal.getFirstDayOfWeek());*
could be replaced with:
*tempCal.set(Calendar.DAY_OF_WEEK, tempCal.MONDAY);*
But it will have affect through out the application.

                                                          *OR*

For time sheet which shows entry(UI) from Monday to Sunday can be changed to 
Sunday to Saturday.

Please let me know, if you have any other idea.

Thanks,
Rahul Singh

> Mismatch between time entry field display and persisted data
> ------------------------------------------------------------
>
>                 Key: OFBIZ-6870
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6870
>             Project: OFBiz
>          Issue Type: Bug
>          Components: specialpurpose/projectmgr
>    Affects Versions: Release Branch 14.12, Trunk, Release Branch 15.12
>            Reporter: Pierre Smits
>
> When a new time sheet is created, the fields for entering the time spent 
> starts on Monday and end on Sunday, however the date range start on Sunday 
> and ends on Saturday. And the latter range is used to persist the data. 
> So when a time entry is done in the field for Monday it is persisted on the 
> Sunday.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to