Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GetCurrentDate {
- constructor(_day, _month, _year) {
- this.day = _day;
- this.month = _month;
- this.year = _year;
- }
- display() {
- // set date to the html element
- document.getElementById('date_wg').innerHTML = `${this.day}/${this.month}/${this.year}`;
- }
- }
- let today = new Date();
- let dd = String(today.getDate()).padStart(2, 0);
- let mm = String(today.getMonth() + 1).padStart(2, 0);
- let yyyy = today.getFullYear();
- currDate = new GetCurrentDate(dd, mm, yyyy);
- currDate.display();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement