mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Calendar: Fix clicking a day in a different month in sidemenu jumped to wrong date
This commit is contained in:
parent
aa2570f2ea
commit
6c17f6c43d
@ -325,8 +325,13 @@ export class SidemenuDate extends Et2Date
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
protected _handleHeaderChange()
|
||||
protected _handleHeaderChange(selectedDates : Date[], value : string)
|
||||
{
|
||||
const update = {};
|
||||
if(this.formatDate(selectedDates[0], this._instance.config.dateFormat) == value)
|
||||
{
|
||||
// Header changed, selected date did not - get a date in the new month
|
||||
|
||||
const maxDays = new Date(this._instance.currentYear, this._instance.currentMonth + 1, 0).getDate();
|
||||
|
||||
let temp_date = new Date("" + this._instance.currentYear + "-" +
|
||||
@ -335,8 +340,14 @@ export class SidemenuDate extends Et2Date
|
||||
);
|
||||
temp_date.setUTCMinutes(temp_date.getUTCMinutes() + temp_date.getTimezoneOffset());
|
||||
|
||||
update['date'] = temp_date;
|
||||
}
|
||||
else
|
||||
{
|
||||
// User selected a date in a different month, header hasn't changed
|
||||
update['date'] = value;
|
||||
}
|
||||
// Go directly
|
||||
let update = {date: temp_date};
|
||||
app.calendar.update_state(update);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user