(fix) enhance display of all-day invitations (fixes #4145)
This commit is contained in:
parent
f28b7f2f8c
commit
43385ce5bf
|
@ -18,6 +18,8 @@ vtodo_class2 = "(Confidential task)";
|
|||
"calendar_label" = "Calendar";
|
||||
"startDate_label" = "Start";
|
||||
"endDate_label" = "End";
|
||||
"time_label" = "Time";
|
||||
"to_label" = "to";
|
||||
"due_label" = "Due Date";
|
||||
"location_label" = "Location";
|
||||
"summary_label" = "Summary";
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#import <NGObjWeb/WOActionResults.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGCards/iCalEvent.h>
|
||||
#import <NGCards/iCalPerson.h>
|
||||
|
@ -186,6 +187,19 @@
|
|||
return sentByText;
|
||||
}
|
||||
|
||||
- (NSTimeInterval) duration
|
||||
{
|
||||
return [[self newEndDate] timeIntervalSinceDate:[self newStartDate]];
|
||||
}
|
||||
|
||||
- (BOOL) isEndDateOnSameDay
|
||||
{
|
||||
if ([[self apt] isAllDay])
|
||||
return ([self duration] <= 86400);
|
||||
|
||||
return [[self newStartDate] isDateOnSameDay: [self newEndDate]];
|
||||
}
|
||||
|
||||
- (NSString *) formattedAptStartDate
|
||||
{
|
||||
NSString *s;
|
||||
|
|
|
@ -221,21 +221,19 @@
|
|||
return [[self dateFormatter] formattedTime: [self endCalendarDate]];
|
||||
}
|
||||
|
||||
- (BOOL) isEndDateOnSameDay
|
||||
{
|
||||
NSCalendarDate *aDate;
|
||||
if ([[self inEvent] isAllDay])
|
||||
aDate = [[self endCalendarDate] dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:-1];
|
||||
else
|
||||
aDate = [self endCalendarDate];
|
||||
return [[self startCalendarDate] isDateOnSameDay: aDate];
|
||||
}
|
||||
|
||||
- (NSTimeInterval) duration
|
||||
{
|
||||
return [[self endCalendarDate] timeIntervalSinceDate:[self startCalendarDate]];
|
||||
}
|
||||
|
||||
- (BOOL) isEndDateOnSameDay
|
||||
{
|
||||
if ([[self inEvent] isAllDay])
|
||||
return [self duration] <= 86400;
|
||||
|
||||
return [[self startCalendarDate] isDateOnSameDay: [self endCalendarDate]];
|
||||
}
|
||||
|
||||
/* calendar folder support */
|
||||
|
||||
- (SOGoAppointmentFolder *) calendarFolder
|
||||
|
|
|
@ -23,10 +23,19 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon
|
|||
><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>
|
||||
</tr></var:if>
|
||||
|
||||
<var:if condition="apt.isAllDay">
|
||||
<tr>
|
||||
<th align="right" style="font-weight: bold;"><var:string label:value="startDate_label" const:escapeHTML="NO"/></th>
|
||||
<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"
|
||||
/><var:if condition="formattedAptStartTime.length"> - <var:string value="formattedAptStartTime" const:escapeHTML="NO"/> <var:string value="viewTZ" const:escapeHTML="NO"/>
|
||||
</var:if></td>
|
||||
|
@ -36,7 +45,8 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon
|
|||
<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>
|
||||
</tr>
|
||||
</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>
|
||||
|
|
Loading…
Reference in a new issue