Issue
I have an element in html5:
<input class="form-control" #semana="ngModel" name="semana" [(ngModel)]="detalle.semana" type="week">
The value I get is a string "2018-W23" for example. What I want is to get the value in date or number entered to perform operations on it (add or subtract days) and save it in my database.
I am working with Angular 5, JAVA spring and MySQL
Solution
You need a conversion function to get a Date object from your week input.
See this discussion : javascript calculate date from week number
It appears there is no standard JS function to do that, so you have to implement your own function (again, see discussion - link above) to parse the week input into a Date object.
Then with your Date object it will be convenient to do operations (add days etc) and save it to your database.
Answered By - Air1
Answer Checked By - Candace Johnson (JavaFixing Volunteer)