Skip to content

Commit

Permalink
fix: make use of dayjs, don't pass icon prop in LayerTreeNode
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch authored and simonseyock committed May 6, 2024
1 parent 7610634 commit c0cffa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/LayerTree/LayerTreeNode/LayerTreeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class LayerTreeNode extends React.PureComponent<LayerTreeNodeProps> {
const {
inResolutionRange,
children,
icon,
...passThroughProps
} = this.props;

Expand Down
7 changes: 5 additions & 2 deletions src/Panel/TimeLayerSliderPanel/TimeLayerSliderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import OlImageWMS from 'ol/source/ImageWMS';
import OlTileWMS from 'ol/source/TileWMS';
import { getUid } from 'ol';

import dayjs from 'dayjs';

import _isFinite from 'lodash/isFinite';
import _isEqual from 'lodash/isEqual';

Expand Down Expand Up @@ -437,7 +439,7 @@ export class TimeLayerSliderPanel extends React.Component<TimeLayerSliderPanelPr
content={
<RangePicker
showTime={{ format: 'HH:mm' }}
defaultValue={[startDate, endDate]}
defaultValue={[dayjs(startDate.toISOString()), dayjs(endDate.toISOString())]}
onOk={range => {
if (!range) {
return;
Expand All @@ -446,7 +448,8 @@ export class TimeLayerSliderPanel extends React.Component<TimeLayerSliderPanelPr
if (!start || !end) {
return;
}
this.updateDataRange([start, end]);

this.updateDataRange([moment(start.toISOString()), moment(end.toISOString())]);
}}
/>
}
Expand Down

0 comments on commit c0cffa8

Please sign in to comment.