Skip to content

Commit 2e0221e

Browse files
authored
Merge pull request #2592 from rstudio/set-min-max
Exit early if date parsing fails
2 parents 29d24d7 + aeded79 commit 2e0221e

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ shiny 1.3.2.9001
4646

4747
* Fixed [#2233](https://github.com/rstudio/shiny/issues/2233): `verbatimTextOutput()` produced wrapped text on Safari, but the text should not be wrapped. ([#2353](https://github.com/rstudio/shiny/pull/2353))
4848

49-
* Fixed [#2335](https://github.com/rstudio/shiny/issues/2335): When `dateInput()`'s `value` was unspecified, and `max` and/or `min` was set to `Sys.Date()`, the value was not being set properly. ([#2526](https://github.com/rstudio/shiny/pull/2526))
49+
* Fixed [#2335](https://github.com/rstudio/shiny/issues/2335): When `dateInput()`'s `value` was unspecified, and `max` and/or `min` was set to `Sys.Date()`, the value was not being set properly. ([#2526](https://github.com/rstudio/shiny/pull/2526))
50+
51+
* Fixed [#2591](https://github.com/rstudio/shiny/issues/2591): Providing malformed date-strings to `min` or `max` no longer results in JS errors for `dateInput()` and `dateRangeInput()`. ([#2592](https://github.com/rstudio/shiny/pull/2592))
5052

5153
* Fixed [rstudio/reactlog#36](https://github.com/rstudio/reactlog/issues/36): Changes to reactive values not displaying accurately in reactlog. ([#2424](https://github.com/rstudio/shiny/pull/2424))
5254

inst/www/shared/shiny.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

srcjs/input_binding_date.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ $.extend(dateInputBinding, {
143143
}
144144

145145
date = this._newDate(date);
146+
// If date parsing fails, do nothing
147+
if (date === null)
148+
return;
149+
146150
date = this._UTCDateAsLocal(date);
147151
if (isNaN(date))
148152
return;
@@ -177,6 +181,10 @@ $.extend(dateInputBinding, {
177181
}
178182

179183
date = this._newDate(date);
184+
// If date parsing fails, do nothing
185+
if (date === null)
186+
return;
187+
180188
date = this._UTCDateAsLocal(date);
181189
if (isNaN(date))
182190
return;

0 commit comments

Comments
 (0)