mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Fix system times zone on ICS and meetings times.
This commit is contained in:
parent
5d5d4d3941
commit
3677770de2
4 changed files with 14 additions and 4 deletions
|
|
@ -139,7 +139,7 @@ std::shared_ptr<linphone::ConferenceInfo> ConferenceInfoModel::findConferenceInf
|
|||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//Note conferenceInfo->getDateTime uses system timezone.
|
||||
QDateTime ConferenceInfoModel::getDateTimeUtc() const{
|
||||
return QDateTime::fromMSecsSinceEpoch(mConferenceInfo->getDateTime() * 1000).toUTC();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,8 @@ Loader{
|
|||
color: ChatCalendarMessageStyle.schedule.color
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: ChatCalendarMessageStyle.schedule.pointSize
|
||||
text: Qt.formatDateTime(mainItem.conferenceInfoModel.dateTime, 'hh:mm')
|
||||
// Reminder: QML use locale time (not system). Use UTC from C++ => convert it into QML => pass QML => convert it into UTC and apply our timezone.
|
||||
text: UtilsCpp.toTimeString(Utils.fromUTC(mainItem.conferenceInfoModel.dateTimeUtc), 'hh:mm')
|
||||
+ (mainItem.conferenceInfoModel.duration > 0 ? ' (' +Utils.formatDuration(mainItem.conferenceInfoModel.duration * 60) + ')'
|
||||
: '')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ Loader{
|
|||
color: ChatCalendarMessageStyle.schedule.color
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Units.dp * 8
|
||||
text: Qt.formatDate(mainItem.conferenceInfoModel.dateTimeUtc, 'yyyy/MM/dd')
|
||||
text: UtilsCpp.toDateString(Utils.fromUTC(mainItem.conferenceInfoModel.dateTimeUtc), 'yyyy/MM/dd')
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
|
|
@ -182,7 +182,8 @@ Loader{
|
|||
color: ChatCalendarMessageStyle.schedule.color
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Units.dp * 8
|
||||
text: Qt.formatDateTime(mainItem.conferenceInfoModel.dateTimeUtc, 'hh:mm')
|
||||
// Reminder: QML use locale time (not system). Use UTC from C++ => convert it into QML => pass QML => convert it into UTC and apply our timezone.
|
||||
text: UtilsCpp.toTimeString( Utils.fromUTC(mainItem.conferenceInfoModel.dateTimeUtc), 'hh:mm')
|
||||
+ (mainItem.conferenceInfoModel.duration > 0 ? ' ('+Utils.formatDuration(mainItem.conferenceInfoModel.duration * 60) + ')'
|
||||
: '')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -562,6 +562,14 @@ function buildDate(date, time){
|
|||
dateTime.setSeconds(time.getSeconds())
|
||||
return dateTime
|
||||
}
|
||||
|
||||
|
||||
function fromUTC(date){
|
||||
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(),
|
||||
date.getUTCDate(), date.getUTCHours(),
|
||||
date.getUTCMinutes(), date.getUTCSeconds()));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
function formatSize (size) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue