Fix the start datetime in conference scheduling by bypassing javascript dates with strings.

This commit is contained in:
Julien Wadel 2024-02-19 08:53:30 +01:00
parent a434eb730a
commit 1bbc35701d
3 changed files with 11 additions and 2 deletions

View file

@ -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());

View file

@ -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<linphone::ConferenceInfo> conferenceInfo);

View file

@ -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