There is an input type = "date" when it is changed, a value is calculated, how to pass this value to a child class. I read the certificate, the parameters are passed there, and if I calculate the property, then how can I get it in the child class in order to further perform the following operations with it
<body> <div class="input"> <input type='date' /> </div> <div class="containerForLastUpdateRecordAndPeriodItems"></div> <script> class dateInput { constructor() { this.input = document.querySelector("input[type='date']"); this.input.onchange = this.onChange; } onChange(event) { this.inputValue = event.target.value; console.log('В датаИмпуте', this.inputValue) this.updateTime = new Date(); console.log('В updateTime', this.updateTime) return this.inputValue; } } class dateRange extends dateInput { constructor() { super(); this.container = document.querySelector('.containerForLastUpdateRecordAndPeriodItems'); } onChange() { console.log(this.inputValue); this.createPeriod(this.inputValue); } createPeriod(date) { let newDate = date; console.log(newDate); newDate.year = newDate.year + 1; return { start: date, end: newDate } } } const range = new dateRange(); </script> </body>