Skip to content

Commit

Permalink
[form-builder] DateInput remove named Moment imprt
Browse files Browse the repository at this point in the history
Use `moment.Moment` instead since this is just a ts-thing that causes
eslint to not be happy.
  • Loading branch information
Benedicte Emilie Brækken authored and benedicteb committed Feb 4, 2021
1 parent 9573931 commit 7c0f366
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'react-datepicker/dist/react-datepicker-cssmodules.css'

import React from 'react'
import ReactDOM from 'react-dom'
import moment, {Moment} from 'moment'
import moment from 'moment'
import DatePicker from 'react-datepicker'
import {isValidationErrorMarker, Marker} from '@sanity/types'
import FormField from 'part:@sanity/components/formfields/default'
Expand All @@ -15,7 +15,7 @@ import styles from './styles/BaseDateTimeInput.css'
import {Layer} from '@sanity/ui'

type Props = {
value: Moment | null
value: moment.Moment | null
markers: Array<Marker>
dateOnly?: boolean
dateFormat: string
Expand All @@ -26,9 +26,9 @@ type Props = {
description: string | null
placeholder: string | null
readOnly: boolean | null
onChange: (event: Moment) => void
onFocus?: (event: any) => void
onBlur?: (event: any) => void
onChange: (event: moment.Moment) => void
level: number
presence: any
}
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class BaseDateTimeInput extends React.Component<Props, State> {
this.setState({inputValue: inputValue})
}
}
handleDialogChange = (nextMoment?: Moment) => {
handleDialogChange = (nextMoment?: moment.Moment) => {
const {onChange} = this.props
onChange(nextMoment)
this.setState({inputValue: null})
Expand Down

0 comments on commit 7c0f366

Please sign in to comment.