mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-13 02:43:17 +00:00
fix(mail): fix end date of all-day event in mail notifications
Fixes #4145
This commit is contained in:
@@ -106,7 +106,8 @@
|
||||
if (!oldStartDate)
|
||||
{
|
||||
ASSIGN (oldStartDate, [[self previousApt] startDate]);
|
||||
[oldStartDate setTimeZone: viewTZ];
|
||||
if (![(iCalEvent*)[self previousApt] isAllDay])
|
||||
[oldStartDate setTimeZone: viewTZ];
|
||||
}
|
||||
return oldStartDate;
|
||||
}
|
||||
@@ -116,33 +117,50 @@
|
||||
if (!newStartDate)
|
||||
{
|
||||
ASSIGN (newStartDate, [[self apt] startDate]);
|
||||
[newStartDate setTimeZone: viewTZ];
|
||||
if (![(iCalEvent*)[self apt] isAllDay])
|
||||
[newStartDate setTimeZone: viewTZ];
|
||||
}
|
||||
return newStartDate;
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) oldEndDate
|
||||
{
|
||||
NSCalendarDate *endDate;
|
||||
|
||||
if (!oldEndDate)
|
||||
{
|
||||
if ([[self previousApt] isKindOfClass: [iCalEvent class]])
|
||||
ASSIGN (oldEndDate, [(iCalEvent*)[self previousApt] endDate]);
|
||||
{
|
||||
endDate = [(iCalEvent*)[self previousApt] endDate];
|
||||
if ([(iCalEvent*)[self previousApt] isAllDay])
|
||||
endDate = [endDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:-1];
|
||||
ASSIGN (oldEndDate, endDate);
|
||||
}
|
||||
else
|
||||
ASSIGN (oldEndDate, [(iCalToDo*)[self previousApt] due]);
|
||||
[oldEndDate setTimeZone: viewTZ];
|
||||
if (![(iCalEvent*)[self previousApt] isAllDay])
|
||||
[oldEndDate setTimeZone: viewTZ];
|
||||
}
|
||||
return oldEndDate;
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) newEndDate
|
||||
{
|
||||
NSCalendarDate *endDate;
|
||||
|
||||
if (!newEndDate)
|
||||
{
|
||||
if ([[self apt] isKindOfClass: [iCalEvent class]])
|
||||
ASSIGN (newEndDate, [(iCalEvent*)[self apt] endDate]);
|
||||
{
|
||||
endDate = [(iCalEvent*)[self apt] endDate];
|
||||
if ([(iCalEvent*)[self apt] isAllDay])
|
||||
endDate = [endDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:-1];
|
||||
ASSIGN (newEndDate, endDate);
|
||||
}
|
||||
else
|
||||
ASSIGN (newEndDate, [(iCalToDo*)[self apt] due]);
|
||||
[newEndDate setTimeZone: viewTZ];
|
||||
if (![(iCalEvent*)[self apt] isAllDay])
|
||||
[newEndDate setTimeZone: viewTZ];
|
||||
}
|
||||
return newEndDate;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,8 @@
|
||||
|
||||
date = [[self inEvent] startDate];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
[date setTimeZone: [ud timeZone]];
|
||||
if (![[self inEvent] isAllDay])
|
||||
[date setTimeZone: [ud timeZone]];
|
||||
|
||||
return date;
|
||||
}
|
||||
@@ -186,12 +187,12 @@
|
||||
if ([self isEndDateOnSameDay] &&
|
||||
![[self inEvent] isAllDay])
|
||||
{
|
||||
[s appendFormat: @" %@", [self labelForKey: @"to"]];
|
||||
[s appendFormat: @" %@", [self labelForKey: @"to_time"]];
|
||||
[s appendFormat: @" %@", [self endTime]];
|
||||
}
|
||||
else if (![self isEndDateOnSameDay])
|
||||
{
|
||||
[s appendFormat: @" %@", [self labelForKey: @"to"]];
|
||||
[s appendFormat: @" %@", [self labelForKey: @"to_date"]];
|
||||
[s appendFormat: @" %@", [self endDate]];
|
||||
|
||||
if (![[self inEvent] isAllDay])
|
||||
@@ -218,7 +219,8 @@
|
||||
|
||||
date = [[self inEvent] endDate];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
[date setTimeZone: [ud timeZone]];
|
||||
if (![[self inEvent] isAllDay])
|
||||
[date setTimeZone: [ud timeZone]];
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
@@ -251,6 +251,12 @@
|
||||
/* Number of selected messages in list */
|
||||
"selected" = "selected";
|
||||
|
||||
/* Date formatting from one time to another time */
|
||||
"to_time" = "to";
|
||||
|
||||
/* Date formatting from one day to another day */
|
||||
"to_date" = "to";
|
||||
|
||||
/* Encrypted message notification */
|
||||
"This message is encrypted" = "This message is encrypted";
|
||||
|
||||
|
||||
@@ -251,6 +251,12 @@
|
||||
/* Number of selected messages in list */
|
||||
"selected" = "sélectionné(s)";
|
||||
|
||||
/* Date formatting from one time to another time */
|
||||
"to_time" = "à";
|
||||
|
||||
/* Date formatting from one day to another day */
|
||||
"to_date" = "au";
|
||||
|
||||
/* Encrypted message notification */
|
||||
"This message is encrypted" = "Ce message est crypté";
|
||||
|
||||
|
||||
@@ -19,11 +19,21 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon
|
||||
padding-bottom: 9px; border-bottom: 1px solid #ccc;" class="ng-hide"><var:string
|
||||
value="getSubject" const:escapeHTML="NO"/> <small style="font-size: 12px; color: #999;"><var:string
|
||||
value="organizerName" const:escapeHTML="NO"/><var:string value="sentByText" const:escapeHTML="NO"/></small></h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr> <var:if condition="location.length"
|
||||
><tr>
|
||||
<th align="right" style="font-weight: bold;"><var:string label:value="location_label" const:escapeHTML="NO"/></th>
|
||||
<td><var:string value="location" const:escapeHTML="NO"/></td>
|
||||
</tr></var:if>
|
||||
|
||||
<var:if condition="apt.isAllDay">
|
||||
<tr>
|
||||
<th align="right" style="font-weight: bold;"><var:string label:value="time_label" const:escapeHTML="NO"/></th>
|
||||
<td><var:string value="formattedAptStartDate"
|
||||
const:escapeHTML="NO"/><var:if condition="isEndDateOnSameDay" const:negate="YES"> <var:string label:value="to_label" const:escapeHTML="NO"/> <var:string value="formattedAptEndDate" const:escapeHTML="NO"/>
|
||||
</var:if></td>
|
||||
</tr>
|
||||
</var:if>
|
||||
<var:if condition="apt.isAllDay" const:negate="YES">
|
||||
<tr>
|
||||
<th align="right" style="font-weight: bold;"><var:string label:value="startDate_label" const:escapeHTML="NO"/></th>
|
||||
<td><var:string value="formattedAptStartDate" const:escapeHTML="NO"
|
||||
@@ -34,8 +44,9 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon
|
||||
<th align="right" style="font-weight: bold;"><var:string label:value="endDate_label" const:escapeHTML="NO"/></th>
|
||||
<td><var:string value="formattedAptEndDate" const:escapeHTML="NO"
|
||||
/><var:if condition="formattedAptEndTime.length"> - <var:string value="formattedAptEndTime" const:escapeHTML="NO"/> <var:string value="viewTZ" const:escapeHTML="NO"/>
|
||||
</var:if></td>
|
||||
</var:if></td>
|
||||
</tr>
|
||||
</var:if>
|
||||
<var:if condition="apt.comment.length"
|
||||
><tr>
|
||||
<th align="right" style="font-weight: bold;"><var:string label:value="comment_label" const:escapeHTML="NO"/></th>
|
||||
|
||||
Reference in New Issue
Block a user