From de11ff7f836cb5968c37474ba04840a71a3caf0c Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Sat, 25 Mar 2006 14:23:42 +0000 Subject: [PATCH] Bug 329226: highlight current day. patch by thomas.benisch@sun.com, r=mvl --- calendar/base/content/calendar-month-view.css | 4 ++ calendar/base/content/calendar-month-view.xml | 27 ++++++++++++++ .../base/content/calendar-multiday-view.css | 8 ++++ .../base/content/calendar-multiday-view.xml | 21 +++++++++++ .../content/datetimepickers/minimonth.xml | 37 +++++++++++++++---- .../classic/datetimepickers/minimonth.css | 4 ++ .../skin/modern/datetimepickers/minimonth.css | 4 ++ .../sunbird/datetimepickers/minimonth.css | 4 ++ .../sunbird/datetimepickers/minimonth.css | 4 ++ 9 files changed, 106 insertions(+), 7 deletions(-) diff --git a/calendar/base/content/calendar-month-view.css b/calendar/base/content/calendar-month-view.css index de5ac20c1fac..ae882ff87653 100644 --- a/calendar/base/content/calendar-month-view.css +++ b/calendar/base/content/calendar-month-view.css @@ -37,6 +37,10 @@ calendar-month-day-box { background: #eeeeee; } +calendar-month-day-box[today="true"] { + background: #dfeaf4 !important; +} + calendar-month-day-box[selected="true"] { background: #ffe79c !important; } diff --git a/calendar/base/content/calendar-month-view.xml b/calendar/base/content/calendar-month-view.xml index 856531e94861..e2553228209c 100644 --- a/calendar/base/content/calendar-month-view.xml +++ b/calendar/base/content/calendar-month-view.xml @@ -914,6 +914,9 @@ var dayCount = 7; var curRow = null; + // get today's date + var today = this.today(); + for each (var date in this.getDateList({})) { var box = createXULElement("calendar-month-day-box"); box.setAttribute("context", this.getAttribute("context")); @@ -956,6 +959,11 @@ } box.monthView = this; + // highlight today + if (date.compare(today) == 0) { + box.setAttribute("today", "true"); + } + // add the box and its data to our stored array var boxdata = { date: date, @@ -1001,6 +1009,9 @@ mainMonth = mainMonth % 12; } + // get today's date + var today = this.today(); + for each (var date in this.getDateList({})) { var box; // Get the next box that we haven't updated from the previously @@ -1041,6 +1052,11 @@ box.showMonthLabel = true; } + // highlight today + if (date.compare(today) == 0) { + box.setAttribute("today", "true"); + } + // The box and its data is already in the array. We fixed the // date at the beginning, when we got it from the array. dateBoxCount++; @@ -1160,6 +1176,17 @@ ]]> + + + + 1 && d.compare(today) == 0) { + dayEventsBox.setAttribute("today", "true"); + dayHeaderBox.setAttribute("today", "true"); + } + var labelbox = createXULElement("box"); labelbox.setAttribute("flex", "1"); labelbox.setAttribute("orient", orient); @@ -2590,6 +2599,18 @@ } ]]> + + + + + diff --git a/calendar/resources/content/datetimepickers/minimonth.xml b/calendar/resources/content/datetimepickers/minimonth.xml index 0d2087221148..b62672f38664 100644 --- a/calendar/resources/content/datetimepickers/minimonth.xml +++ b/calendar/resources/content/datetimepickers/minimonth.xml @@ -156,6 +156,7 @@