From 2f1eb1ddf5b5c8f34be3d4adfe529feb409eb6ad Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 2 Nov 2020 20:41:40 +0100 Subject: [PATCH] fixing a glitch at creating new events at the weekly view --- .../simplemobiletools/calendar/pro/fragments/WeekFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt index ae44730ba..9f88aced6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt @@ -30,6 +30,7 @@ import com.simplemobiletools.commons.views.MyTextView import kotlinx.android.synthetic.main.fragment_week.* import kotlinx.android.synthetic.main.fragment_week.view.* import org.joda.time.DateTime +import org.joda.time.DateTimeZone import org.joda.time.Days import java.util.* @@ -270,7 +271,8 @@ class WeekFragment : Fragment(), WeeklyCalendar { applyColorFilter(primaryColor.getContrastColor()) setOnClickListener { - val timestamp = weekTimestamp + index * DAY_SECONDS + hour * 60 * 60 + val offset = DateTimeZone.getDefault().getOffsetFromLocal(System.currentTimeMillis()) / 1000 + val timestamp = weekTimestamp - offset + index * DAY_SECONDS + hour * 60 * 60 Intent(context, EventActivity::class.java).apply { putExtra(NEW_EVENT_START_TS, timestamp) putExtra(NEW_EVENT_SET_HOUR_DURATION, true)