Skip to content
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

Feature Datepicker #2

Open
SallyMcGrath opened this issue Dec 18, 2024 · 0 comments
Open

Feature Datepicker #2

SallyMcGrath opened this issue Dec 18, 2024 · 0 comments
Labels
🧩 Feature 🏝️ Priority Stretch Do this once mandatory and key work is done 🦑 Size Large 4-8 hours 📅 Week 4 Assigned during Week 4 of this module

Comments

@SallyMcGrath
Copy link
Collaborator

28. Date picker

Instructions: Add the 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' <input> 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

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 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, CodeYourFuture#26 used validation. Searching npmjs.com for 'validate' shows multiple packages, such as 'validator' and '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?
@SallyMcGrath SallyMcGrath added 🏝️ Priority Stretch Do this once mandatory and key work is done 📅 Week 4 Assigned during Week 4 of this module 🦑 Size Large 4-8 hours 🧩 Feature labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧩 Feature 🏝️ Priority Stretch Do this once mandatory and key work is done 🦑 Size Large 4-8 hours 📅 Week 4 Assigned during Week 4 of this module
Projects
None yet
Development

No branches or pull requests

1 participant