зеркало из https://github.com/mozilla/pjs.git
Fixed bug 198859: times of events are displayed 1 hour later than they should be
This commit is contained in:
Родитель
455721ccbd
Коммит
733026cee7
|
@ -239,3 +239,12 @@ NS_IMETHODIMP oeDateTimeImpl::GetTzID(char **aRetVal)
|
|||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int oeDateTimeImpl::CompareDate( oeDateTimeImpl *anotherdt ) {
|
||||
if( m_datetime.year == anotherdt->m_datetime.year &&
|
||||
m_datetime.month == anotherdt->m_datetime.month &&
|
||||
m_datetime.day == anotherdt->m_datetime.day )
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
oeDateTimeImpl();
|
||||
virtual ~oeDateTimeImpl();
|
||||
void AdjustToWeekday( short weekday );
|
||||
int CompareDate( oeDateTimeImpl *anotherdt );
|
||||
/* additional members */
|
||||
struct icaltimetype m_datetime;
|
||||
char *m_tzid;
|
||||
|
|
|
@ -1933,7 +1933,7 @@ bool oeICalEventImpl::ParseIcalComponent( icalcomponent *comp )
|
|||
prop = icalcomponent_get_first_property( vevent, ICAL_DTSTART_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
m_start->m_datetime = icalproperty_get_dtstart( prop );
|
||||
m_start->m_datetime.is_utc = false;
|
||||
m_start->m_datetime.is_utc = false;
|
||||
if( m_start->m_datetime.is_date == true ) {
|
||||
m_allday = true;
|
||||
m_start->SetHour( 0 );
|
||||
|
@ -1966,6 +1966,12 @@ bool oeICalEventImpl::ParseIcalComponent( icalcomponent *comp )
|
|||
prop = icalcomponent_get_first_property( vevent, ICAL_DTEND_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
m_end->m_datetime = icalproperty_get_dtend( prop );
|
||||
m_end->m_datetime.is_utc = false;
|
||||
if( m_end->m_datetime.is_date == true ) {
|
||||
m_end->SetHour( 0 );
|
||||
m_end->SetMinute( 0 );
|
||||
m_end->m_datetime.is_date = false; //Because currently we depend on m_datetime being a complete datetime value.
|
||||
}
|
||||
icalparameter *tmppar = icalproperty_get_first_parameter( prop, ICAL_TZID_PARAMETER );
|
||||
const char *tzid=nsnull;
|
||||
if( tmppar )
|
||||
|
@ -2466,7 +2472,7 @@ icalcomponent* oeICalEventImpl::AsIcalComponent()
|
|||
if( m_end && !icaltime_is_null_time( m_end->m_datetime ) ) {
|
||||
char *tzid=nsnull;
|
||||
m_end->GetTzID( &tzid );
|
||||
if( m_allday && !tzid ) {
|
||||
if( m_allday && !tzid && m_end->CompareDate( m_start )==0 ) {
|
||||
m_end->SetHour( 23 );
|
||||
m_end->SetMinute( 59 );
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче