Skip to content

Commit

Permalink
Cleaning code
Browse files Browse the repository at this point in the history
  • Loading branch information
berhalak committed Oct 25, 2024
1 parent 1ff88b6 commit cce6d13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion timeline/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ const options: TimelineOptions = {
const group = idToName.get(item.group).split('|').map(formatValue);
const start = moment(item.start).format('YYYY-MM-DD');

if (!(item.end instanceof Date) || !(item.start instanceof Date)) {
if (!(item.start instanceof Date)) {
console.error('Invalid date');
return;
}


// In group we have list of values, we need to create an object from it (zip it with columns).

Expand All @@ -258,6 +260,8 @@ const options: TimelineOptions = {
await grist.setCursorPos({rowId: id});

callback(null);

openCard();
},

// allow manipulation of items
Expand Down
4 changes: 3 additions & 1 deletion timeline/out/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49088,7 +49088,8 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
async onAdd(item, callback) {
const group = idToName.get(item.group).split("|").map(formatValue);
const start = (0, import_moment_timezone.default)(item.start).format("YYYY-MM-DD");
if (!(item.end instanceof Date) || !(item.start instanceof Date)) {
if (!(item.start instanceof Date)) {
console.error("Invalid date");
return;
}
const end = (0, import_moment_timezone.default)(defaultEnd(item.start)).format("YYYY-MM-DD");
Expand All @@ -49099,6 +49100,7 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
const { id: id2 } = await grist.selectedTable.create({ fields });
await grist.setCursorPos({ rowId: id2 });
callback(null);
openCard();
},
// allow manipulation of items
// editable: true,
Expand Down
4 changes: 2 additions & 2 deletions timeline/out/index.js.map

Large diffs are not rendered by default.

0 comments on commit cce6d13

Please sign in to comment.