Skip to content

Commit

Permalink
fix: end date picker allows to select invalid value (#21)
Browse files Browse the repository at this point in the history
## Description

- Fixed possibility of inputting start date bigger than the end date
- Fixed the ability to inputting end date on create ticket category

Closes: BON-754

<!-- Add a description of the changes that this PR introduces and the
files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is
not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type
prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json)
  in the PR title
- [ ] targeted the correct branch
- [ ] provided a link to the relevant issue or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable
and please add
your handle next to the items reviewed if you only reviewed selected
items.*

I have...

- [ ] confirmed the
correct [type
prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json)
in the PR title
- [ ] confirmed all author checklist items have been addressed
  • Loading branch information
Alessandro Mazzon authored Oct 24, 2023
1 parent 618826d commit 10bbd51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import "./style.css";
import { DatePicker } from "antd";
import dayjs from "dayjs";
import React, { useState } from "react";
import "./style.css";

interface Props {
readonly startLabel?: string;
Expand Down Expand Up @@ -64,7 +64,7 @@ const BondscapeDateTimePicker = ({
value={initialStartValue ? dayjs(initialStartValue) : undefined}
disabledDate={
maxDate
? (current) => current < maxDate
? (current) => current > maxDate
: (current) => current < dayjs()
}
onChange={(date) => {
Expand Down
2 changes: 1 addition & 1 deletion app/creator/create/[[...id]]/CreateTicketCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const CreateTicketCategory = ({
setFieldValue("availableFrom", value)
}
onChangeEnd={(value) =>
setFieldValue("availableTill", value)
setFieldValue("availableUntil", value)
}
/>
<div className="flex flex-col bg-bondscape-text_neutral_100 rounded-[16px] gap-[0.75rem] py-[16px]">
Expand Down

0 comments on commit 10bbd51

Please sign in to comment.