mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
feat(calendar): make it so that events with customized calendar:startDate
and calendar:endDate
can be drag&dropped on the calendar view
This commit is contained in:
parent
3fe78cad61
commit
6c1cb71c9f
@ -229,8 +229,13 @@ export default class CalendarView extends ViewMode {
|
||||
return;
|
||||
}
|
||||
|
||||
attributes.setAttribute(note, "label", "startDate", startDate);
|
||||
attributes.setAttribute(note, "label", "endDate", endDate);
|
||||
// Since they can be customized via calendar:startDate=$foo and calendar:endDate=$bar we need to determine the
|
||||
// attributes to be effectively updated
|
||||
const startAttribute = note.getAttributes("label").filter(attr => attr.name == "calendar:startDate").shift()?.value.replace("#", "")||"startDate"
|
||||
const endAttribute = note.getAttributes("label").filter(attr => attr.name == "calendar:endDate").shift()?.value.replace("#", "")||"endDate"
|
||||
|
||||
attributes.setAttribute(note, "label", startAttribute, startDate);
|
||||
attributes.setAttribute(note, "label", endAttribute, endDate);
|
||||
}
|
||||
|
||||
onEntitiesReloaded({ loadResults }: EventData<"entitiesReloaded">) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user