From 3764d9a1fbac63452ce9da8fdabfa83c49f8004d Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Sun, 28 Jun 2020 12:03:06 -0500 Subject: tweaks to date picker --- src/client/views/collections/CollectionSchemaCells.tsx | 9 +++++++-- src/client/views/collections/CollectionSchemaView.scss | 10 +++++----- src/fields/DateField.ts | 4 ++++ 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 0a2c538c2..cdcc67294 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -34,6 +34,7 @@ import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView" import ReactDOM from "react-dom"; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; +import { DateField } from "../../../fields/DateField"; const path = require('path'); library.add(faExpand); @@ -374,15 +375,19 @@ export class CollectionSchemaDateCell extends CollectionSchemaCell { docFilters: returnEmptyFilter }; @observable private _field = this.prop.Document[this.prop.fieldKey]; + @observable private _date = new Date(); + @action handleChange = (date: any) => { + this._date = date; this.prop.Document[this.prop.fieldKey] = date; } render() { return this.handleChange(date)} + onChange={date => this.handleChange(date)} />; } } diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss index 2926a8f6f..fa1f01448 100644 --- a/src/client/views/collections/CollectionSchemaView.scss +++ b/src/client/views/collections/CollectionSchemaView.scss @@ -62,14 +62,14 @@ width: calc(100% - 52px); margin-left: 50px; - z-index: 10000; + z-index: 100; overflow-y: visible; &.-header { font-size: 12px; height: 30px; box-shadow: none; - z-index: 10000; + z-index: 100; overflow-y: visible; } @@ -180,7 +180,7 @@ .collectionSchemaView-header { height: 100%; color: gray; - z-index: 10000; + z-index: 100; overflow-y: visible; display: flex; justify-content: space-between; @@ -188,10 +188,10 @@ .collectionSchema-header-menu { height: 100%; - z-index: 10000; + z-index: 100; .collectionSchema-header-toggler { - z-index: 10000; + z-index: 100; width: 100%; height: 100%; padding: 4px; diff --git a/src/fields/DateField.ts b/src/fields/DateField.ts index a925148c2..bee62663e 100644 --- a/src/fields/DateField.ts +++ b/src/fields/DateField.ts @@ -29,6 +29,10 @@ export class DateField extends ObjectField { [ToString]() { return this.date.toISOString(); } + + getDate() { + return this.date; + } } Scripting.addGlobal(function d(...dateArgs: any[]) { -- cgit v1.2.3-70-g09d2