fixing a glitch at creating new events at the weekly view
This commit is contained in:
parent
34139e4078
commit
2f1eb1ddf5
|
@ -30,6 +30,7 @@ import com.simplemobiletools.commons.views.MyTextView
|
||||||
import kotlinx.android.synthetic.main.fragment_week.*
|
import kotlinx.android.synthetic.main.fragment_week.*
|
||||||
import kotlinx.android.synthetic.main.fragment_week.view.*
|
import kotlinx.android.synthetic.main.fragment_week.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
|
import org.joda.time.DateTimeZone
|
||||||
import org.joda.time.Days
|
import org.joda.time.Days
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
@ -270,7 +271,8 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
||||||
applyColorFilter(primaryColor.getContrastColor())
|
applyColorFilter(primaryColor.getContrastColor())
|
||||||
|
|
||||||
setOnClickListener {
|
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 {
|
Intent(context, EventActivity::class.java).apply {
|
||||||
putExtra(NEW_EVENT_START_TS, timestamp)
|
putExtra(NEW_EVENT_START_TS, timestamp)
|
||||||
putExtra(NEW_EVENT_SET_HOUR_DURATION, true)
|
putExtra(NEW_EVENT_SET_HOUR_DURATION, true)
|
||||||
|
|
Loading…
Reference in New Issue