CodeYourFuture / CodeYourFuture/React-Module-Project

Feature Datepicker

Đang mở
#27 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
🏝️ Priority Stretch 📅 Week 4 🦑 Size Large 🧩 Feature
Ngôn ngữ chính
JavaScript
Star
1
Fork
28
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 28. Date picker

**Instructions:** Add the [js-datepicker](https://www.npmjs.com/package/js-datepicker) package to your project using `npm install`, and import it at the top of your booking table component. Add different IDs to your 'check in date' and 'check out date' `` elements, then create two date pickers using `const checkInPicker = datepicker(YOUR_ID)` (where `YOUR_ID` is the ID you assigned to your check in/check out date elements).

**Hint:** Read the [js-datepicker usage guide](https://www.npmjs.com/package/js-datepicker#basic-usage)

**Test:**

The date picker appears when you click on the 'check in date' and 'check out date' input elements.

**Reflection:**

Using `js-datepicker` in this exercise allows you to practice installing and working with packages in JavaScript.

Packages contain new functions and properties to work with that may not be available in native JavaScript/HTML. Using packages can often save time instead of writing your own functions, as you are importing code that someone else has written. However, this can have downsides:
- not all packages are high quality
- some may have bugs or may reduce accessibility by recreating native elements

(`js-datepicker` recreates HTML's native [datepicker](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date) element)

Think about some of the code you have written in this project. Are there any packages available that might have helped you to complete the features?

For example, #26 used validation. Searching npmjs.com for '[validate](https://www.npmjs.com/search?q=validate)' shows multiple packages, such as '[validator](https://www.npmjs.com/package/validator)' and '[Validate](https://www.npmjs.com/package/Validate)'.

Open both of these packages in your browser, and consider the following questions:

- Is it clear what this package does? Will it solve my specific problem better than writing my own code?
- Do I trust that the code in this package is safe to run on my machine? Do other people trust this package? (Hint: look at weekly downloads, last update, dependents, and visit the repository)
- Is this package accessible? Will it work on all browsers?
- If I decide to use this package and it breaks, will I know how to fix it or replace it?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu trong component bảng đặt chỗ và xem lại hướng dẫn sử dụng cơ bản của js-datepicker được liên kết trong issue. Thêm package, đặt các ID khác nhau cho các input check-in và check-out, rồi tạo một picker cho mỗi input. Hoàn tất khi một date picker xuất hiện lúc nhấp vào một trong hai input.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
50/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.