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

[EXTERNAL] Clarify the need to implement the create_date function for birth date conversion #2744

Closed
wants to merge 1 commit into from

Conversation

amali01
Copy link

@amali01 amali01 commented Sep 30, 2024

Why?

The create_date function is necessary to properly convert a string (e.g., "2015-09-05") into a NaiveDate format for the Form struct's birth field. Without this function, the date field cannot be processed correctly, and the form validation will not work as expected.

This update ensures that all the requirements of this question are clear, avoiding confusion and time waste.

Clarify the need to implement the create_date function for birth date conversion
@@ -5,6 +5,7 @@
For this exercise, you will have to implement an **error type** for a form validator. This must validate the password and the first name.

The first name must not be empty and the password must have **at least 8 characters**, and a combination of **alphabetic**, **numeric** and **none-alphanumeric** (`<`, `&`, `/` ...).
Additionally, you need to create a helper function create_date that converts a string like "2015-09-05" into a NaiveDate format.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question for this exercise to build the error type form validator, the data will be given as input in the right format.
they can use NaiveDate::parse_from_str(date_str, "%Y-%m-%d") if needed for test so no need to create a function to converts the date

@@ -15,7 +16,7 @@ Examples:
Create a structure named `Form` that will have the following fields:
- `first_name`: `String`
- `last_name`: `String`
- `birth`: `NaiveDate` that will convert a string `"2015-09-05"` to a date of that format.
- `birth`: `NaiveDate` (converted from a string using the create_date function).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description here have no meaning since we have a data type NaiveDate.
Please remove the description from here then i can approve your PR

@amali01 amali01 closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants