moment-hijri icon indicating copy to clipboard operation
moment-hijri copied to clipboard

date.locale() returns undefined. Errors when using with antd DatePicker

Open ashgkwd opened this issue 5 years ago • 0 comments

If moment-hijri object is passed to DatePicker from antd as value prop; then DatePicker errors because return of value.locale() is undefined

minimal codes to reproduce

import moment from "moment-hijri";
import { DatePicker } from "antd";

export default const HijriDatePicker = (props) => {
  return <DatePicker value={props.value} format="DD-MM-YYYY (iDD-iMM-iYYYY)" />
}

Here is CodeSandbox link to test it live.

ashgkwd avatar Nov 29 '18 09:11 ashgkwd