Skip to content

Commit

Permalink
fix: DateTimePickerinput typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Jun 8, 2018
1 parent 7de3b7b commit 665ad7e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
21 changes: 13 additions & 8 deletions packages/react-widgets/src/DateTimePickerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,21 @@ class DateTimePickerInput extends React.Component {

state = {}

static getDerivedStateFromProps(nextProps) {
static getDerivedStateFromProps(nextProps, prevState) {
let { value, editing, editFormat, format, culture } = nextProps
let textValue = formatDate(
value,
editing && editFormat ? editFormat : format,
culture
)

return {
textValue: formatDate(
value,
editing && editFormat ? editFormat : format,
culture
),
}
if (prevState.lastValueFromProps !== textValue)
return {
textValue,
lastValueFromProps: textValue,
}

return null
}

focus() {
Expand Down
2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"common-tags": "^1.7.2",
"css-literal-loader": "^0.4.1",
"date-arithmetic": "^3.1.0",
"gatsby": "2.0.0-alpha.49",
"gatsby": "2.0.0-alpha.51",
"gatsby-link": "^1.6.38-12",
"gatsby-plugin-catch-links": "^1.0.19",
"gatsby-plugin-less": "2.0.0-alpha.15",
Expand Down
14 changes: 7 additions & 7 deletions www/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4511,7 +4511,7 @@ gatsby-cli@^1.1.41-11:
yargs "^11.1.0"
yurnalist "^0.2.1"

gatsby-link@^1.6.38-12:
gatsby-link@^1.6.38-12, gatsby-link@^1.6.38-13:
version "1.6.44"
resolved "https://registry.yarnpkg.com/gatsby-link/-/gatsby-link-1.6.44.tgz#31912e66d3b21632ce27e5b7310ec88d9a75eac3"
dependencies:
Expand Down Expand Up @@ -4610,9 +4610,9 @@ gatsby-transformer-remark@^1.7.37:
unist-util-select "^1.5.0"
unist-util-visit "^1.1.1"

[email protected].49:
version "2.0.0-alpha.49"
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-2.0.0-alpha.49.tgz#9f02f92a8fef7eb85326567c89dd797cd47f5bf9"
[email protected].51:
version "2.0.0-alpha.51"
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-2.0.0-alpha.51.tgz#e6bb17331b3f264d87e3489131db645455998256"
dependencies:
"@babel/code-frame" "7.0.0-beta.47"
"@babel/core" "7.0.0-beta.47"
Expand Down Expand Up @@ -4666,7 +4666,7 @@ [email protected]:
front-matter "^2.1.0"
fs-extra "^5.0.0"
gatsby-cli "^1.1.41-11"
gatsby-link "^1.6.38-12"
gatsby-link "^1.6.38-13"
gatsby-react-router-scroll "^1.0.12-10"
glob "^7.1.1"
graphql "^0.13.2"
Expand Down Expand Up @@ -8162,12 +8162,12 @@ react-transition-group@^2.0.0, react-transition-group@^2.2.0, react-transition-g
prop-types "^15.6.1"

"react-widgets-globalize@file:../packages/localizer-globalize":
version "5.0.6"
version "5.0.7"
dependencies:
prop-types "^15.6.1"

"react-widgets@file:../packages/react-widgets":
version "4.3.0"
version "4.3.1"
dependencies:
classnames "^2.1.2"
date-arithmetic "^3.1.0"
Expand Down

0 comments on commit 665ad7e

Please sign in to comment.