forked from gpbl/react-day-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gpbl#518 from gpbl/momentless
Replace moment specifier with format/parse functions
- Loading branch information
Showing
23 changed files
with
507 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
|
||
import DayPickerInput from 'react-day-picker/DayPickerInput'; | ||
import 'react-day-picker/lib/style.css'; | ||
|
||
import MomentLocaleUtils, { | ||
formatDate, | ||
parseDate, | ||
} from 'react-day-picker/moment'; | ||
|
||
import 'moment/locale/it'; | ||
|
||
export default function Example() { | ||
return ( | ||
<div> | ||
<p>In English (default):</p> | ||
<DayPickerInput | ||
formatDate={formatDate} | ||
parseDate={parseDate} | ||
placeholder={`${formatDate(new Date())}`} | ||
/> | ||
<p> | ||
In Italian, using <code>{'format="LL"'}</code>: | ||
</p> | ||
<DayPickerInput | ||
formatDate={formatDate} | ||
parseDate={parseDate} | ||
format="LL" | ||
placeholder={`${formatDate(new Date(), 'LL', 'it')}`} | ||
dayPickerProps={{ | ||
locale: 'it', | ||
localeUtils: MomentLocaleUtils, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.