Skip to content

Commit

Permalink
antd message for past date
Browse files Browse the repository at this point in the history
  • Loading branch information
lade6501 committed Oct 17, 2024
1 parent d02cdf0 commit 7f38ea3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/Pages/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import pic3 from '../../assets/img/abt2.png';
import pic4 from '../../assets/img/abt3.png';
import pic5 from '../../assets/img/abt4.png';
import MainHOC from '../MainHOC';
import { message } from 'antd';

function Register() {
const [date, setDate] = useState('');
Expand Down Expand Up @@ -39,7 +40,7 @@ function Register() {
if (date.length === 10 && date < minDate) {
// Reset to today's date if the selected date is invalid
setDate(minDate);
alert('You cannot select a date before today.');
message.warning('You cannot select a date before today.');
}
};

Expand Down

0 comments on commit 7f38ea3

Please sign in to comment.