aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index dbaa6e110..5c0eba860 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -261,18 +261,18 @@ export class SchemaDateCell extends ObservableReactComponent<SchemaTableCellProp
}
@action
- handleChange = (date: any) => {
+ handleChange = (date: Date | null) => {
// const script = CompileScript(date.toString(), { requiredType: "Date", addReturn: true, params: { this: Doc.name } });
// if (script.compiled) {
// this.applyToDoc(this._document, this._props.row, this._props.col, script.run);
// } else {
// ^ DateCast is always undefined for some reason, but that is what the field should be set to
- this._props.Document[this._props.fieldKey] = new DateField(date as Date);
+ date && (this._props.Document[this._props.fieldKey] = new DateField(date));
//}
};
render() {
- return <DatePicker dateFormat={'Pp'} selected={this.date.date} onChange={(date: any) => this.handleChange(date)} />;
+ return <DatePicker dateFormat="Pp" selected={this.date.date} onChange={date => this.handleChange(date)} />;
}
}
@observer