diff --git a/README.md b/README.md index 7748387290..4d0504479d 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,7 @@ This section provides a comprehensive reference for all Parse Dashboard configur | `supportedPushLocales` | Array<String> | yes | - | - | - | `["en","fr"]` | Supported locales for push notifications. | | `preventSchemaEdits` | Boolean | yes | `false` | - | - | `true` | Prevent schema modifications through the dashboard. | | `preventDataExport` | Boolean | yes | `false` | - | - | `true` | Hide all data browser export options (export data, export selected/all rows, export schema). | +| `useLocalTime` | Boolean | yes | `false` | - | - | `true` | Display and edit dates in the viewer's local time zone instead of UTC. Dates are always stored in UTC. | | `columnPreference` | Object | yes | - | - | - | `{"_User":[...]}` | Column visibility/sorting/filtering preferences. See [column preferences details](#prevent-columns-sorting). | | `classPreference` | Object | yes | - | - | - | `{"_Role":{...}}` | Persistent filters for all users. See [persistent filters details](#persistent-filters). | | `enableSecurityChecks` | Boolean | yes | `false` | - | - | `true` | Enable security checks under App Settings > Security. | diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index 74cbe7ca04..d213ff9f22 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -18,8 +18,11 @@ import ScriptConfirmationModal from 'components/ScriptConfirmationModal/ScriptCo import styles from 'components/BrowserCell/BrowserCell.scss'; import baseStyles from 'stylesheets/base.scss'; import * as ColumnPreferences from 'lib/ColumnPreferences'; +import { CurrentApp } from 'context/currentApp'; export default class BrowserCell extends Component { + static contextType = CurrentApp; + constructor() { super(); @@ -153,7 +156,7 @@ export default class BrowserCell extends Component { } else if (typeof value === 'string') { this.props.value = new Date(this.props.value); } - this.copyableValue = content = dateStringUTC(this.props.value); + this.copyableValue = content = dateStringUTC(this.props.value, this.context?.useLocalTime); } else if (this.props.type === 'Boolean') { this.copyableValue = content = this.props.value ? 'True' : 'False'; } else if (this.props.type === 'Object' || this.props.type === 'Bytes') { diff --git a/src/components/BrowserFilter/BrowserFilter.react.js b/src/components/BrowserFilter/BrowserFilter.react.js index 3e33b7d21c..f152f63652 100644 --- a/src/components/BrowserFilter/BrowserFilter.react.js +++ b/src/components/BrowserFilter/BrowserFilter.react.js @@ -824,6 +824,7 @@ export default class BrowserFilter extends React.Component { active={this.props.filters.size > 0} editMode={this.state.editMode} parentContentId={POPOVER_CONTENT_ID} + useLocalTime={this.context.useLocalTime} /> )} /> diff --git a/src/components/BrowserFilter/FilterRow.react.js b/src/components/BrowserFilter/FilterRow.react.js index 787cfd7f09..647634e748 100644 --- a/src/components/BrowserFilter/FilterRow.react.js +++ b/src/components/BrowserFilter/FilterRow.react.js @@ -180,7 +180,8 @@ function compareValue( setFocus, currentConstraint, modifiers, - onChangeModifiers + onChangeModifiers, + useLocalTime ) { if (currentConstraint === 'containedIn') { return ( @@ -279,6 +280,7 @@ function compareValue( return ( onChangeCompareTo(Parse._encode(value))} @@ -309,6 +311,7 @@ const FilterRow = ({ active, parentContentId, editMode, + useLocalTime, }) => { const setFocus = useCallback(input => { if (input !== null && editMode) { @@ -421,7 +424,8 @@ const FilterRow = ({ setFocus, currentConstraint, modifiers, - onChangeModifiers + onChangeModifiers, + useLocalTime )}