From the course: Code Clinic: JavaScript

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Controlling the interface

Controlling the interface - JavaScript Tutorial

From the course: Code Clinic: JavaScript

Start my 1-month free trial

Controlling the interface

- [Instructor] Now that our chart is looking pretty good, it's time to build this interface part of our application. So what I wanna do is make sure that people can switch to a different date right here and have it automatically update this chart. So it's gonna require two parts. First part is getting the information from the current date and time into these fields and then tracking an event, so that when somebody changes one of these fields, then the chart will automatically update. So we'll take care of putting the information into the fields first. Now, to do that, I'm using a special library called Moment that allows you to deal with dates and times. Now, whenever you have to work with dates and times in JavaScript, in jQuery, and in input fields as well as, like, SQL and PHP, you're gonna notice that every language has a slightly different version of what time should be. So this is a really good library that gives you lots of options for formatting things. Now, I know that we…

Contents