mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed meeting schedule using 'all day' toggle
This commit is contained in:
parent
9ed2415d1b
commit
2821d4b72f
1 changed files with 33 additions and 4 deletions
|
|
@ -404,10 +404,39 @@ class ScheduleMeetingViewModel @UiThread constructor() : GenericViewModel() {
|
|||
conferenceInfo.subject = subject.value
|
||||
conferenceInfo.description = description.value
|
||||
|
||||
val startTime = startTimestamp / 1000 // Linphone expects timestamp in seconds
|
||||
conferenceInfo.dateTime = startTime
|
||||
val duration = (((endTimestamp - startTimestamp) / 1000) / 60).toInt() // Linphone expects duration in minutes
|
||||
conferenceInfo.duration = duration
|
||||
if (allDayMeeting.value == true) {
|
||||
val cal = Calendar.getInstance(
|
||||
TimeZone.getTimeZone(selectedTimeZone.value?.id ?: TimeZone.getDefault().id)
|
||||
)
|
||||
cal.timeInMillis = startTimestamp
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0)
|
||||
cal.set(Calendar.MINUTE, 0)
|
||||
cal.set(Calendar.SECOND, 0)
|
||||
val startTime = cal.timeInMillis / 1000 // Linphone expects timestamp in seconds
|
||||
|
||||
cal.timeInMillis = endTimestamp
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0)
|
||||
cal.set(Calendar.MINUTE, 0)
|
||||
cal.set(Calendar.SECOND, 0)
|
||||
cal.add(Calendar.HOUR, 24)
|
||||
val endTime = cal.timeInMillis / 1000 // Linphone expects timestamp in seconds
|
||||
val duration = ((endTime - startTime) / 60).toInt() // Linphone expects duration in minutes
|
||||
|
||||
Log.i(
|
||||
"$TAG Scheduling meeting using start day [$startTime] and duration [$duration] (minutes)"
|
||||
)
|
||||
conferenceInfo.dateTime = startTime
|
||||
conferenceInfo.duration = duration
|
||||
} else {
|
||||
val startTime = startTimestamp / 1000 // Linphone expects timestamp in seconds
|
||||
val duration =
|
||||
(((endTimestamp - startTimestamp) / 1000) / 60).toInt() // Linphone expects duration in minutes
|
||||
Log.i(
|
||||
"$TAG Scheduling meeting using start hour [$startTime] and duration [$duration] (minutes)"
|
||||
)
|
||||
conferenceInfo.dateTime = startTime
|
||||
conferenceInfo.duration = duration
|
||||
}
|
||||
|
||||
val participantsList = participants.value.orEmpty()
|
||||
val participantsInfoList = arrayListOf<ParticipantInfo>()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue