fix some bugs
This commit is contained in:
16
main.js
16
main.js
@@ -134,12 +134,12 @@ function scanFile(editor, data)
|
|||||||
res = [...line.matchAll("\\[(" + DateFormat.date + "(?:-" + DateFormat.date + ")?)\\]")];
|
res = [...line.matchAll("\\[(" + DateFormat.date + "(?:-" + DateFormat.date + ")?)\\]")];
|
||||||
if (res.length > 0)
|
if (res.length > 0)
|
||||||
{
|
{
|
||||||
if ((res[0] == "[-]" && res.length > 1) || res[0] != "[-]")
|
if (res[0][0] == "[-]" && res.length > 1)
|
||||||
|
{
|
||||||
|
res[0] = res[1];
|
||||||
|
}
|
||||||
|
if (res[0][0] != "[-]")
|
||||||
{
|
{
|
||||||
if (res[0][0] == "[-]")
|
|
||||||
{
|
|
||||||
res[0] = res[1];
|
|
||||||
}
|
|
||||||
res = res[0]
|
res = res[0]
|
||||||
res[1] = parseDate(res[1], defal);
|
res[1] = parseDate(res[1], defal);
|
||||||
let procesed = processLine(line, line.replace(res[0], ''), res[1], data);
|
let procesed = processLine(line, line.replace(res[0], ''), res[1], data);
|
||||||
@@ -432,7 +432,7 @@ class CalendarView extends ItemView
|
|||||||
{
|
{
|
||||||
let day = date[0].day() - 1
|
let day = date[0].day() - 1
|
||||||
day = (day == -1) ? 6 : day;
|
day = (day == -1) ? 6 : day;
|
||||||
if (event.date.match(DateFormat.time) == '12:00am')
|
if (event.date.match(DateFormat.time)[0] == '12:00am')
|
||||||
{
|
{
|
||||||
this.renderEvent(event, this.allday[day]);
|
this.renderEvent(event, this.allday[day]);
|
||||||
}
|
}
|
||||||
@@ -446,7 +446,7 @@ class CalendarView extends ItemView
|
|||||||
|
|
||||||
renderEvent(event, container)
|
renderEvent(event, container)
|
||||||
{
|
{
|
||||||
el = container.createEl('div', {
|
let el = container.createEl('div', {
|
||||||
cls: 'frcal__event',
|
cls: 'frcal__event',
|
||||||
id: "fr_event_" + event.id,
|
id: "fr_event_" + event.id,
|
||||||
attr: {
|
attr: {
|
||||||
@@ -516,7 +516,7 @@ class FRCalander extends Plugin
|
|||||||
app.workspace.setActiveLeaf(leaf);
|
app.workspace.setActiveLeaf(leaf);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.data = this.loadData();
|
this.data = await this.loadData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user