Possible Bug in 3.0.0

Topics brought up by the TimeTrex open source community.
Locked
Batrams
Posts: 45
Joined: Mon Aug 18, 2008 9:11 am

Possible Bug in 3.0.0

Post by Batrams »

Today I tried to add an absence for an employee using the same method I've been using for months. The absence however appears on the day prior to when it should. For example if I add an absence for Nov 13th, it shows up on the 12th. I can work around this by adding it on the day after the proper day but this looks like a bug?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I'm not able to replicate this issue on our end.

Things to check:

What is the timezone set to under your preferences?

What is the timezone set to under the preferences of the employee which you are adding the absence for?

In your pay period schedule, what do you have "Assign Shifts To" set to?
Batrams
Posts: 45
Joined: Mon Aug 18, 2008 9:11 am

Post by Batrams »

Hi - thanks for the reply.

Both timezones are set to:
Time Zone: (GMT -4.00)
Time Zone: (GMT -4.00)

Assign Shifts To: Day they start on

Any further advice is welcome
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Is it possible to for us to login to your TimeTrex installation to see the issue for ourselves and try a few things?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Thanks for sending us the debug information, I passed it on to our developers and they confirmed its a bug with the new timezone handling in v3.0 specifically when entering time when "todays" date is before the DST switchover and the date you entering time for is after the DST switchover.

Its a one-line fix, if you edit: classes/modules/core/UserDateFactory.class.php, and around line: 180 you will find the following function definition:

Code: Select all

	static function findOrInsertUserDate($user_id, $date, $timezone = NULL ) {
Immediately after this line change it so it looks like this:

Code: Select all

	static function findOrInsertUserDate($user_id, $date, $timezone = NULL ) {
		$date = TTDate::getMiddleDayEpoch( $date );
You will need to re-enter all time after the DST switchover date once this change is made of course.

v3.0.1 of TimeTrex, once released, will include this fix.
Batrams
Posts: 45
Joined: Mon Aug 18, 2008 9:11 am

Post by Batrams »

shaunw wrote:You will need to re-enter all time after the DST switchover date once this change is made of course.
Thanks for the fix. Can you please explain more clearly what you mean by the above quote?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Basically any time entered that appeared on the wrong day should be re-entered on the correct day.
Locked