From 1bbc35701d05d5f8287ed2441e1a1060ab053d2b Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 19 Feb 2024 08:53:30 +0100 Subject: [PATCH] Fix the start datetime in conference scheduling by bypassing javascript dates with strings. --- .../src/components/conferenceInfo/ConferenceInfoModel.cpp | 8 ++++++++ .../src/components/conferenceInfo/ConferenceInfoModel.hpp | 3 ++- linphone-app/ui/views/App/Dialog/NewConference.qml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp index 712b605eb..93a08f42e 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.cpp @@ -271,6 +271,14 @@ void ConferenceInfoModel::setDateTime(const QDate& date, const QTime& time, Time setDateTime(QDateTime(date, time, model->getTimeZone())); } +void ConferenceInfoModel::setDateTimeStr(const QString& date, const QString& time, TimeZoneModel * model){ + setIsScheduled(true); + QDateTime t = QDateTime::fromString(date + " " +time, "yyyy/MM/dd hh:mm:ss"); + t.setTimeZone(model->getTimeZone()); + setDateTime(t); +} + + void ConferenceInfoModel::setDuration(const int& duration){ mConferenceInfo->setDuration(duration); setIsEnded(getIsEnded()); diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp index 8a8a5a3f7..c625e4d7b 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp @@ -98,7 +98,8 @@ public: void setIsEnded(const bool& end); void setInviteMode(const int& modes); - Q_INVOKABLE void setDateTime(const QDate& date, const QTime& time, TimeZoneModel * model); + void setDateTime(const QDate& date, const QTime& time, TimeZoneModel * model); + Q_INVOKABLE void setDateTimeStr(const QString& date, const QString& time, TimeZoneModel * model); Q_INVOKABLE void setParticipants(ParticipantListModel * participants); void setConferenceInfo(std::shared_ptr conferenceInfo); diff --git a/linphone-app/ui/views/App/Dialog/NewConference.qml b/linphone-app/ui/views/App/Dialog/NewConference.qml index b5b33ac0e..8032a0006 100644 --- a/linphone-app/ui/views/App/Dialog/NewConference.qml +++ b/linphone-app/ui/views/App/Dialog/NewConference.qml @@ -130,7 +130,7 @@ DialogPlus { } conferenceManager.creationState = 1 if( scheduledSwitch.checked){ - conferenceInfoModel.setDateTime(UtilsCpp.toDate(dateField.getDateString(), 'yyyy/MM/dd'), timeField.getTime()+':00', timeZoneField.model.getAt(timeZoneField.currentIndex) ) + conferenceInfoModel.setDateTimeStr(dateField.getDateString(), timeField.getTime()+':00', timeZoneField.model.getAt(timeZoneField.currentIndex) ) conferenceInfoModel.duration = durationField.model[durationField.currentIndex].value }else{ conferenceInfoModel.isScheduled = false