mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 14:43:31 +00:00
feat(calendar): Add week number on month view. Fixes #4457.
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
"this month" = "this month";
|
||||
"Previous Month" = "Previous Month";
|
||||
"Next Month" = "Next Month";
|
||||
/* Week number prefix */
|
||||
"W" = "W";
|
||||
|
||||
/* Year */
|
||||
"this year" = "this year";
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
"this month" = "ce mois";
|
||||
"Previous Month" = "Mois précédent";
|
||||
"Next Month" = "Mois suivant";
|
||||
/* Week number prefix */
|
||||
"W" = "S";
|
||||
|
||||
/* Year */
|
||||
"this year" = "Cette année";
|
||||
|
||||
@@ -234,6 +234,19 @@
|
||||
return daysNumbersToDisplay[i];
|
||||
}
|
||||
|
||||
- (BOOL) isFirstDayOfWeek {
|
||||
return 0 == [currentWeek indexOfObject: currentTableDay];
|
||||
}
|
||||
|
||||
- (int) currentWeekNumber
|
||||
{
|
||||
SOGoUser *user;
|
||||
|
||||
user = [context activeUser];
|
||||
|
||||
return [user weekNumberForDate: currentTableDay];
|
||||
}
|
||||
|
||||
- (void) setCurrentWeek: (NSArray *) newCurrentWeek
|
||||
{
|
||||
ASSIGN (currentWeek, newCurrentWeek);
|
||||
|
||||
@@ -89,6 +89,12 @@
|
||||
var:sg-day="currentTableDay.shortDateString"
|
||||
var:sg-day-number="currentDayNumber"
|
||||
var:sg-day-string="currentTableDay.iso8601DateString">
|
||||
<!-- Week number -->
|
||||
<var:if condition="isFirstDayOfWeek">
|
||||
<div class="sg-calendar-tile-week">
|
||||
<span class="md-default-theme md-default-theme md-hue-1 md-bg"><var:string label:value="W"/><var:string value="currentWeekNumber"/></span>
|
||||
</div>
|
||||
</var:if>
|
||||
<div class="sg-calendar-tile-header md-default-theme md-fg md-hue-2">
|
||||
<var:if condition="currentTableDay.isToday">
|
||||
<span class="md-default-theme md-bg md-accent md-hue-2"><var:string value="currentTableDay.dayOfMonth"/></span> <var:string value="dayHeaderMonth"/>
|
||||
|
||||
@@ -242,6 +242,27 @@ $quarter_height: 10px;
|
||||
//font-weight: $sg-font-light;
|
||||
}
|
||||
|
||||
// Header of month week
|
||||
.sg-calendar-tile-week {
|
||||
font-size: $sg-font-size-2;
|
||||
min-height: $sg-font-size-2 + 10px;
|
||||
overflow: hidden;
|
||||
padding: 4px;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
//font-weight: $sg-font-light;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
.sg-calendar-tile-week span {
|
||||
padding: 1%;
|
||||
border-radius: 30%;
|
||||
color: $colorGrey50;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// The left column of hours
|
||||
.hours {
|
||||
display: inline-block;
|
||||
|
||||
Reference in New Issue
Block a user