Improve display of current day in month view

pull/110/head
Francis Lachapelle 2015-10-02 15:13:30 -04:00
parent d27c792324
commit e1393c3af2
4 changed files with 28 additions and 49 deletions

View File

@ -1,8 +1,6 @@
/* UIxCalMonthView.h - this file is part of SOGo /* UIxCalMonthView.h - this file is part of SOGo
* *
* Copyright (C) 2006-2009 Inverse inc. * Copyright (C) 2006-2015 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -69,7 +67,6 @@
- (void) setCurrentTableDay: (NSCalendarDate *) newCurrentTableDay; - (void) setCurrentTableDay: (NSCalendarDate *) newCurrentTableDay;
- (NSCalendarDate *) currentTableDay; - (NSCalendarDate *) currentTableDay;
- (NSString *) labelForCurrentDayCell;
@end @end

View File

@ -1,8 +1,6 @@
/* UIxCalMonthView.m - this file is part of SOGo /* UIxCalMonthView.m - this file is part of SOGo
* *
* Copyright (C) 2006, 2007 Inverse inc. * Copyright (C) 2006-2015 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -235,27 +233,6 @@
return currentWeek; return currentWeek;
} }
- (NSString *) labelForCurrentDayCell
{
NSCalendarDate *lastDayOfMonth;
NSString *label, *monthOfYear;
int dayOfMonth;
dayOfMonth = [currentTableDay dayOfMonth];
lastDayOfMonth = [currentTableDay lastDayOfMonth];
if (dayOfMonth == 1
|| [currentTableDay isDateOnSameDay: lastDayOfMonth])
{
monthOfYear
= [monthNames objectAtIndex: [currentTableDay monthOfYear]];
label = [NSString stringWithFormat: @"%d %@", dayOfMonth, monthOfYear];
}
else
label = [NSString stringWithFormat: @"%d", dayOfMonth];
return label;
}
- (NSString *) headerDayCellClasses - (NSString *) headerDayCellClasses
{ {
unsigned int dayOfWeek; unsigned int dayOfWeek;
@ -265,24 +242,19 @@
return [NSString stringWithFormat: @"headerDay day%d", dayOfWeek]; return [NSString stringWithFormat: @"headerDay day%d", dayOfWeek];
} }
- (NSString *) dayHeaderNumber - (NSString *) dayHeaderMonth
{ {
NSString *nameOfMonth, *dayHeaderNumber; NSString *nameOfMonth = nil;
unsigned int dayOfMonth; unsigned int dayOfMonth;
dayOfMonth = [currentTableDay dayOfMonth]; dayOfMonth = [currentTableDay dayOfMonth];
if (dayOfMonth == 1 if (dayOfMonth == 1
|| [currentTableDay isDateOnSameDay: [currentTableDay lastDayOfMonth]]) || [currentTableDay isDateOnSameDay: [currentTableDay lastDayOfMonth]])
{ {
nameOfMonth nameOfMonth = [self localizedNameForMonthOfYear: [currentTableDay monthOfYear]];
= [self localizedNameForMonthOfYear: [currentTableDay monthOfYear]];
dayHeaderNumber = [NSString stringWithFormat: @"%d %@", dayOfMonth,
nameOfMonth];
} }
else
dayHeaderNumber = [NSString stringWithFormat: @"%d", dayOfMonth];
return dayHeaderNumber; return nameOfMonth;
} }
- (NSString *) dayCellClasses - (NSString *) dayCellClasses

View File

@ -64,17 +64,19 @@
var:id="currentDayId" var:id="currentDayId"
> >
<div layout="column" layout-fill="true"> <div layout="column" layout-fill="true">
<div class="sg-calendar-tile-header md-default-theme md-fg md-hue-2">
<var:if condition="currentTableDay.isToday"> <var:if condition="currentTableDay.isToday">
<div class="sg-calendar-tile-header md-default-theme md-bg md-accent md-hue-2"><var:string value="dayHeaderNumber"/></div> <span class="md-default-theme md-bg md-accent md-hue-2"><var:string value="currentTableDay.dayOfMonth"/></span> <var:string value="dayHeaderMonth"/>
</var:if> </var:if>
<var:if condition="currentTableDay.isToday" const:negate="YES"> <var:if condition="currentTableDay.isToday" const:negate="YES">
<div class="sg-calendar-tile-header md-default-theme md-fg md-hue-2"><var:string value="dayHeaderNumber"/></div> <span class=""><var:string value="currentTableDay.dayOfMonth"/></span> <var:string value="dayHeaderMonth"/>
</var:if> </var:if>
</div>
<md-content> <md-content>
<sg-calendar-month-day <sg-calendar-month-day
sg-blocks="calendar.views[0].blocks" sg-blocks="calendar.views[0].blocks"
sg-click="list.openEvent(event, component)" sg-click="list.openEvent(event, component)"
var:sg-day="currentTableDay.shortDateString"><!-- day's events --></sg-calendar-month-day> var:sg-day="currentTableDay.shortDateString"><!-- day's events --></sg-calendar-month-day>
</md-content> </md-content>
</div> </div>
</md-grid-tile> </md-grid-tile>

View File

@ -212,17 +212,25 @@ $scrollbar_width: 16px;
&.dayOfAnotherMonth { &.dayOfAnotherMonth {
background-color: rgb(250, 250, 250); background-color: rgb(250, 250, 250);
//border-color: #ddd; //border-color: #ddd;
.sg-calendar-tile-header { .sg-calendar-tile-header,
.sg-calendar-tile-header > span {
color: rgb(221, 221, 221) !important; // Overwrite dynamic CSS theme color: rgb(221, 221, 221) !important; // Overwrite dynamic CSS theme
} }
} }
&.dayOfToday { &.dayOfToday {
.sg-calendar-tile-header { .sg-calendar-tile-header {
border-radius: 50%; > span {
color: #fff; border-radius: 50%;
display: inline; color: #fff;
font-weight: 600; display: inline-block;
margin-right: auto; font-weight: 600;
margin-right: auto;
margin-left: 1px;
min-width: $sg-font-size-2 + 4px;
min-height: $sg-font-size-2 + 4px;
line-height: $sg-font-size-2 + 4px;
text-align: center;
}
} }
} }
} }