Skip to content

Commit

Permalink
Handle reservation end limit (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 authored Mar 31, 2024
1 parent 4caa007 commit a28062b
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 331 deletions.
154 changes: 0 additions & 154 deletions components/reservation/equip.reservation.create.modal.tsx

This file was deleted.

170 changes: 0 additions & 170 deletions components/reservation/place.reservation.create.modal.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions components/reservation/reservation.calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const ReservationCalendar = ({
view={"month"}
prev2Label={null}
next2Label={null}
minDate={moment().subtract(1, 'month').startOf('month').toDate()}
maxDate={moment().add(30, 'day').toDate()}
tileContent={({ date, _ }) => {
let color = null;
if (markedDates.find((x) => moment(x).format('YYYY-MM-DD') === moment(date).format("YYYY-MM-DD"))) {
Expand Down
4 changes: 3 additions & 1 deletion pages/reservation/equipment/[association]/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const EquipReservationCreatePage: React.FunctionComponent<{
{ withCredentials: true }).
then(res => setUserInfo(res.data)).
catch(() => {
if (process.env.NEXT_PUBLIC_ENV === 'local')
return;
alert('로그인 후 예약 할 수 있습니다.');
router.push('/auth/login');
})
Expand Down Expand Up @@ -142,7 +144,7 @@ const EquipReservationCreatePage: React.FunctionComponent<{
setDate={setDate} setStartTime={setStartTime} setEndTime={setEndTime}
/>
</Form.Group>

<div className={'field'}>
<label>예약 현황</label>
<div>
Expand Down
4 changes: 3 additions & 1 deletion pages/reservation/equipment/[association]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const EquipAssociationPage: React.FunctionComponent<{
}> = ({ association, equipmentList }) => {
const router = useRouter();

const sortedEquipList = equipmentList.sort((a, b) => { return a.name > b.name ? 1 : -1 })

const [selectedDate, setSelectedDate] = useState(moment().format('YYYYMMDD'))
const [markedDates, setMarkedDates] = useState<Date[]>([])
const [dongyeonBank, setDongyeonBank] = useState('')
Expand Down Expand Up @@ -76,7 +78,7 @@ const EquipAssociationPage: React.FunctionComponent<{
<Grid columns={2} divided stackable>

<Grid.Column width={6}>
<EquipListTable equipments={equipmentList}/>
<EquipListTable equipments={sortedEquipList}/>
{
association == "dongyeon"
? <p>
Expand Down
4 changes: 2 additions & 2 deletions pages/reservation/equipment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const EquipmentIndexPage = () => {
</Card.Content>
</Card>
</Grid.Column>
<Grid.Column>
{/* <Grid.Column>
<Card href={'/reservation/equipment/saengna'} centered>
<LogoImage src={'/reservation/saengna.jpg'} alt={'saengna'}/>
<Card.Content>
<Card.Header>생각나눔</Card.Header>
<Card.Meta>Committee Advisory Council</Card.Meta>
</Card.Content>
</Card>
</Grid.Column>
</Grid.Column> */}
</Grid>
</Layout>
)
Expand Down
Loading

0 comments on commit a28062b

Please sign in to comment.