Skip to content

Commit bedf31e

Browse files
JustinElmscode-factordwayne-hart
authored
Limit the date ranges of class4 calendars (DFO-Ocean-Navigator#1052)
* Revert "Bump jquery-ui from 1.12.1 to 1.13.2 in /oceannavigator/frontend (DFO-Ocean-Navigator#1043)" This reverts commit 5b83780. * limit date ranges * [CodeFactor] Apply fixes Co-authored-by: codefactor-io <[email protected]> Co-authored-by: Dwayne Hart <[email protected]>
1 parent b7dc0ba commit bedf31e

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

kml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/data/kml
1+
E:/data/kml

oceannavigator/frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"i18next-browser-languagedetector": "^6.1.2",
3030
"glob-parent": "^5.1.2",
3131
"jquery": "~3.5.0",
32-
"jquery-ui": "^1.13.2",
32+
"jquery-ui": "^1.12.1",
3333
"jquery-ui-month-picker": "kidsysco/jquery-ui-month-picker",
3434
"ol": "^6.6.1",
3535
"papaparse": "^5.2.0",

oceannavigator/frontend/src/components/MapToolbar.jsx

+12-5
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,22 @@ class MapToolbar extends React.Component {
8181
let button = null;
8282
let div = null;
8383
let class4Files = null;
84+
let minDate = null;
85+
let maxDate = null;
8486
switch (type){
8587
case "ocean_predict":
8688
button = $(ReactDOM.findDOMNode(this.class4OPButton));
8789
div = this.class4OpDiv;
88-
class4Files = this.state.class4OPFiles
90+
class4Files = this.state.class4OPFiles;
91+
minDate = new Date(2019, 1, 1);
92+
maxDate = new Date(2022, 1, 27);
8993
break;
9094
case "riops_obs":
9195
button = $(ReactDOM.findDOMNode(this.class4RAOButton));
9296
div = this.class4RAODiv;
93-
class4Files = this.state.class4RAOFiles
97+
class4Files = this.state.class4RAOFiles;
98+
minDate = new Date(2022, 1, 1);
99+
maxDate = new Date(2022, 4, 30);
94100
break;
95101
}
96102
this.class4Picker = $(div).datepicker({
@@ -100,7 +106,8 @@ class MapToolbar extends React.Component {
100106
onSelect: function(text, picker) {
101107
this.props.action("show", "class4", class4Files[text], type);
102108
}.bind(this),
103-
defaultDate: this.state.class4Current,
109+
minDate: minDate,
110+
maxDate: maxDate
104111
});
105112
$(div).css("left", button.offset() + "px");
106113
this.forceUpdate();
@@ -111,9 +118,9 @@ class MapToolbar extends React.Component {
111118
const formatted = $.datepicker.formatDate("yy-mm-dd", d);
112119
var date = null;
113120
if (type == 'ocean_predict') {
114-
date = this.state.class4OPFiles.hasOwnProperty(formatted)
121+
date = this.state.class4OPFiles.hasOwnProperty(formatted);
115122
} else {
116-
date = this.state.class4RAOFiles.hasOwnProperty(formatted)
123+
date = this.state.class4RAOFiles.hasOwnProperty(formatted);
117124
}
118125
return [date, "", null];
119126
}

oceannavigator/frontend/yarn.lock

+4-11
Original file line numberDiff line numberDiff line change
@@ -2897,17 +2897,10 @@ jquery-ui-month-picker@kidsysco/jquery-ui-month-picker:
28972897
version "3.0.4"
28982898
resolved "https://codeload.github.com/kidsysco/jquery-ui-month-picker/tar.gz/6bf5fcb6a38b07206162383468283e68d3e10e97"
28992899

2900-
jquery-ui@^1.13.2:
2901-
version "1.13.2"
2902-
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.13.2.tgz#de03580ae6604773602f8d786ad1abfb75232034"
2903-
integrity sha512-wBZPnqWs5GaYJmo1Jj0k/mrSkzdQzKDwhXNtHKcBdAcKVxMM3KNYFq+iJ2i1rwiG53Z8M4mTn3Qxrm17uH1D4Q==
2904-
dependencies:
2905-
jquery ">=1.8.0 <4.0.0"
2906-
2907-
"jquery@>=1.8.0 <4.0.0":
2908-
version "3.6.0"
2909-
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470"
2910-
integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==
2900+
jquery-ui@^1.12.1:
2901+
version "1.12.1"
2902+
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.12.1.tgz#bcb4045c8dd0539c134bc1488cdd3e768a7a9e51"
2903+
integrity sha1-vLQEXI3QU5wTS8FIjN0+dop6nlE=
29112904

29122905
jquery@~3.5.0:
29132906
version "3.5.1"

0 commit comments

Comments
 (0)