Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,630 --> 00:00:04,530
In this video we're going to start working on this next input right here that is gonna track an input
2
00:00:04,530 --> 00:00:09,870
date we're going to eventually add in a new pipe that is going to allow us to take the data that the
3
00:00:09,870 --> 00:00:14,020
user enters right here and print it out in a very nice formatted manner.
4
00:00:14,040 --> 00:00:15,010
Let's get to it.
5
00:00:15,020 --> 00:00:17,710
Well first start by going over to our component class.
6
00:00:17,770 --> 00:00:21,650
I'm going to add on a new property to my app component called Date.
7
00:00:21,660 --> 00:00:22,560
This will be a string.
8
00:00:22,560 --> 00:00:25,240
It'll be whatever date the user enters.
9
00:00:25,310 --> 00:00:30,960
I'll then also define a method inside of here called on date change which we will use to eventually
10
00:00:30,990 --> 00:00:36,780
update the value of that property on side of your will receive some kind of value as a string.
11
00:00:36,780 --> 00:00:40,780
Then use it to update the start date.
12
00:00:41,040 --> 00:00:42,340
That looks good.
13
00:00:42,340 --> 00:00:44,730
Now let's go back over to our template.
14
00:00:44,740 --> 00:00:46,060
HERE IT IS RIGHT HERE.
15
00:00:46,120 --> 00:00:49,690
I'M GOING TO FIND THAT BIG div with class row.
16
00:00:49,690 --> 00:00:51,600
When do we just put together a moment to go.
17
00:00:51,810 --> 00:00:53,110
But there's the divide class row.
18
00:00:53,110 --> 00:00:58,210
Inside there is the form group and the other class of div right there as well.
19
00:00:58,300 --> 00:01:02,860
Going to duplicate this entire section right here and we'll go through and just change a couple of different
20
00:01:02,860 --> 00:01:03,630
names.
21
00:01:03,670 --> 00:01:09,640
We don't have to write out all this safety mail again I'm going to copy that entire thing and then paste
22
00:01:09,640 --> 00:01:10,990
it directly underneath
23
00:01:14,010 --> 00:01:16,160
what I'm going to zoom back in here.
24
00:01:16,220 --> 00:01:20,450
I'm going to change a couple of different labels and whatnot inside make sure that's really clear that
25
00:01:20,450 --> 00:01:22,230
this is some kind of date input.
26
00:01:22,860 --> 00:01:30,010
I'm going to make sure that I have a label of payment dates going to change the name of the callback
27
00:01:30,040 --> 00:01:35,160
on the input element to on dates change.
28
00:01:35,320 --> 00:01:41,100
I'm going to change the name inside the label down here to payment eight.
29
00:01:41,250 --> 00:01:46,130
I'm going to update the string interpolation to just say date we won't worry about a pipe just yet.
30
00:01:46,180 --> 00:01:50,270
I mean finally really most important thing here is to find that input element.
31
00:01:50,370 --> 00:01:56,280
I'm going to add a type of date to it that's going to cause our browser to show a nicely formatted date
32
00:01:56,280 --> 00:01:57,600
picker to our users.
33
00:01:57,740 --> 00:02:02,580
And it's just going to ensure that a user enters the correct format for us.
34
00:02:02,650 --> 00:02:07,130
So going to save this I'll go back with my browser and test this thing out.
35
00:02:07,180 --> 00:02:09,530
We're going to immediately see this new section right here.
36
00:02:09,610 --> 00:02:12,280
And here is the date picker element.
37
00:02:12,280 --> 00:02:17,830
You'll notice that my date picker is in the format of month day and year if your environment is configured
38
00:02:17,830 --> 00:02:18,330
differently.
39
00:02:18,340 --> 00:02:22,570
And when I say environment I'm talking about your browser and the language you're using on your computer
40
00:02:22,870 --> 00:02:27,460
you might see a different form out of date right here specifically they then the month and then the
41
00:02:27,460 --> 00:02:30,960
year everything should eventually work out regardless.
42
00:02:31,110 --> 00:02:37,720
Then site here I can manually enter and be like 12 12 1912 and we'll see the results of a change event
43
00:02:37,720 --> 00:02:44,350
or an input event on that input right there is going to be a string that formats the date as the year
44
00:02:44,950 --> 00:02:49,570
then the month and the day maybe I should actually change the date to be something else.
45
00:02:49,570 --> 00:02:49,990
There we go.
46
00:02:50,140 --> 00:02:58,130
So you're on a 10 day they're just working at the string like this is not super useful for us.
47
00:02:58,260 --> 00:03:01,220
We want to have something that eventually looks like that right there.
48
00:03:01,380 --> 00:03:08,220
So the month as a full month name and the day and then a comma and then the year let's take a pause
49
00:03:08,220 --> 00:03:08,690
right here.
50
00:03:08,710 --> 00:03:12,420
We're going to come back the next video and figure out how we can use a new pipe that we're gonna learn
51
00:03:12,420 --> 00:03:15,210
about the format the string in a much better fashion.
5233
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.