We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class CalcController { constructor(){ this._locale = 'pt-BR'; this._displayCalcEl = document.querySelector("#display"); this._timeEl = document.querySelector("#hora"); this._dateEl = document.querySelector("#data"); this._currentDate; this.initialize(); this.initButtonsEvents();
} initialize(){ setInterval(()=>{ this.displayDate = this.currentDate.toLocaleDateString(this._locale); this.displayTime = this.currentDate.toLocaleTimeString(this._locale); }, 1000); } addEventListenerAll(element, events, fn){ events.split(' ').forEach(event =>{ element.addEvenrListener(event, fn, false); }); } initButtonsEvents(){ let buttons = document.querySelectorAll("#buttons > g, #parts > g"); buttons.forEach((btn, index)=>{ this.addEventListenerAll(btn, "click drag mouseover", e =>{ console.log(btn.className.baseVal.replace("btn-","")); }) }) } get displayTime(){ return this._timeEl.innerHTML; } set displayTime(value){ return this._timeEl.innerHTML = value; } get displayDate(){ return this._dateEl.innerHTML; } set displayDate(value){ return this._dateEl.innerHTML = value; } get displayCalc(){ return this._displayCalcEl.innerHTML; } set displayCalc(value){ this._displayCalcEl.innerHTML = value; } get currentDate(){ return new Date(); } set currentDate(value){ this._currentDate = value; }
}
The text was updated successfully, but these errors were encountered:
Não acho o erro !!
Sorry, something went wrong.
Também o meu da erro no click, mas é no split dizendo que não é uma função, já resolveu ?
sim
Fala.. a linha 6 onde esta #dados this._dateEl = document.querySelector ("# dados"); escreva se =>-> this._dateEl = document.querySelector ("# data");
Agarrei na 14 e não sai nem pro Rai, revi o código esta tudo ok, parece até que editaram o vídeo e esqueceram de algo.
No branches or pull requests
class CalcController {
constructor(){
this._locale = 'pt-BR';
this._displayCalcEl = document.querySelector("#display");
this._timeEl = document.querySelector("#hora");
this._dateEl = document.querySelector("#data");
this._currentDate;
this.initialize();
this.initButtonsEvents();
}
The text was updated successfully, but these errors were encountered: