Skip to content

Commit

Permalink
feat: adjust default value to hours
Browse files Browse the repository at this point in the history
  • Loading branch information
mholthausen committed Sep 20, 2024
1 parent df98ab1 commit 52a43a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
transformIgnorePatterns: [
'node_modules/(?!(ol|@camptocamp/inkmap|@terrestris/*[a-z]*-util|d3-selection|color-*[a-z]*)|(rc-*[a-z]*)|' +
'filter-obj|query-string|decode-uri-component|split-on-first|shpjs/|rbush|quickselect|geostyler-openlayers-parser|' +
'geostyler-style)'
'geostyler-style|geotiff|quick-lru)'
],
setupFiles: [
'<rootDir>/jest/__mocks__/matchMediaMock.js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TimeLayerSliderPanelExample extends React.Component {
initEndDate={moment()}
timeAwareLayers={this.layers}
tooltips={tooltips}
autoPlaySpeedOptions={[0.5, 1, 2, 3, 4, 5, 600]}
autoPlaySpeedOptions={[0.5, 1, 2, 3]}
dateFormat='YYYY-MM-DD HH:mm'
/>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/Panel/TimeLayerSliderPanel/TimeLayerSliderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ export const TimeLayerSliderPanel: React.FC<TimeLayerSliderPanelProps> = memo(

if (_isFinite(playbackSpeed)) {
wmsTimeHandler(
moment(newValue.clone().add(playbackSpeed, 'seconds').format())
moment(newValue.clone().add(playbackSpeed, 'hours').format())
);
setCurrentValue(
moment(newValue.clone().add(playbackSpeed, 'seconds').format())
moment(newValue.clone().add(playbackSpeed, 'hours').format())
);
} else {
const time = moment(
Expand Down Expand Up @@ -502,7 +502,7 @@ export const TimeLayerSliderPanel: React.FC<TimeLayerSliderPanelProps> = memo(
pressedIcon={<FontAwesomeIcon icon={faPauseCircle} />}
/>
<Select
defaultValue={1}
defaultValue={'hours'}
className={extraCls + ' speed-picker'}
onChange={onPlaybackSpeedChange}
popupMatchSelectWidth={false}
Expand Down

0 comments on commit 52a43a1

Please sign in to comment.