mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 331485 Use selected day from view as start date for new tasks in setDefaultAlarmValues(). r=mvl
This commit is contained in:
parent
41b40d7f8c
commit
27c899acb7
@ -374,6 +374,18 @@ function getContrastingTextColor(bgColor)
|
||||
return "black";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the selected day in the views in a platform (Sunbird vs. Lightning)
|
||||
* neutral way
|
||||
*/
|
||||
function getSelectedDay() {
|
||||
var sbView = document.getElementById("view-deck");
|
||||
var ltnView = document.getElementById("calendar-view-box");
|
||||
var viewDeck = sbView || ltnView;
|
||||
return viewDeck.selectedPanel.selectedDay;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read default alarm settings from user preferences and apply them to
|
||||
* the event/todo passed in.
|
||||
@ -409,8 +421,7 @@ function setDefaultAlarmValues(aItem)
|
||||
if (alarmsBranch.getIntPref("onfortodos") == 1) {
|
||||
// You can't have an alarm if the entryDate doesn't exist.
|
||||
if (!aItem.entryDate) {
|
||||
// XXX We should use the selected day from view instead
|
||||
aItem.entryDate = now();
|
||||
aItem.entryDate = getSelectedDay().clone();
|
||||
}
|
||||
var alarmOffset = Components.classes["@mozilla.org/calendar/duration;1"]
|
||||
.createInstance(Components.interfaces.calIDuration);
|
||||
|
Loading…
x
Reference in New Issue
Block a user