-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some suggestions for features #7
Comments
@Angelk90 i already have plans of adding these features, as i am not getting enough time to work on this, it may take some time. and i have added date format support for now with the latest version. |
@Angelk90 may i know what kind of project you are using it in ? |
@aadilhasan : Consider the following scenario: <PickerWithCustomePlaceholder
onDateSelected={this.onDateChanges}
onClose={this.onDateChanges}
placeholderText="Select date range"
dateFormat="MMMM dd YYYY @ h:mi A"
selectTime
/> import TextField from "@material-ui/core/TextField";
import InputAdornment from "@material-ui/core/InputAdornment";
import IconButton from "@material-ui/core/IconButton";
import CalendarToday from "@material-ui/icons/EventNote";
const PickerWithCustomePlaceholder = ({ onDateSelected, onClose, placeholderText, dateFormat, selectTime }) => {
const placeholder = ({ startDate, endDate }) => {
let _startDate = "";
let _endDate = "";
if (startDate)
_startDate = `${startDate.getDate()}/${startDate.getMonth() +
1}/${startDate.getFullYear()}`;
if (endDate)
_endDate = `${endDate.getDate()}/${endDate.getMonth() +
1}/${endDate.getFullYear()}`;
const handleClickShow = () => {
console.log("show");
};
return (
<TextField
id="Calendar"
label={placeholderText}
value={_startDate && _startDate + " - " + _endDate}
InputProps={{
endAdornment: (
<InputAdornment position="end" className={"passwordView"}>
<IconButton
aria-label="Toggle password visibility"
onClick={handleClickShow}
>
<CalendarToday />
</IconButton>
</InputAdornment>
)
}}
/>
);
};
return (
<DatePicker
onDateSelected={onDateSelected}
onClose={onClose}
placeholder={placeholder}
dateFormat={dateFormat}
selectTime={selectTime}
/>
);
}; How can I use what was passed as dateFormat if I use a placeholder? I should use it on different projects, but as you can imagine I use a graphic from material ui for the input field. For example in a project I need the possibility to select the range between two dates plus the time, but not to select past dates. Have you seen the bug I reported to you? |
@Angelk90 yes i have seen the bugs you reported, i will work on them. and if you are using a custom placeholder then you will have to format the date yourself. |
@aadilhasan : |
@Angelk90 |
@aadilhasan : |
@aadilhasan : Are there any news? #7, #8, #9 |
@Angelk90 not all of them, these are mostly features, i was working on bug fixes and some must have feature, i will soon start working on remaining. |
@aadilhasan : Is there any news? |
@Angelk90 everything is work in progress. |
Hi @aadilhasan ,
It would be possible to implement the following features:
selectTime
istrue
, give the possibility to decide for theAM-PM
format or the24-hour
format.dd/mm/yyyy
ordd-mm-yyyy h:mm
.~
or-
, or other.Bug, looking at the following example from the first calendar which is of type
disableRange
:If the Today button is selected, a range is set, but it should not be so, then if I select a different date than today, setting the time, strange things happen.
The last date I selected with the time previously set from the current date is set, from which the current date that I had previously selected with the last time I set was set.
Link: https://codesandbox.io/s/react-range-picker-8bdzy
Then take a look at:
src/components/date-grid/index.js
line 42 do not make areturn false;
but onlyfalse;
The text was updated successfully, but these errors were encountered: