Last active
May 28, 2018 12:33
-
-
Save GiselaMD/0cc245247f65af2398178c7a730b041c to your computer and use it in GitHub Desktop.
Broken Window Theory - Date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-item *ngIf="message.from !== username" class="messageNotUser" [ngClass]="{'my_message': message.from === username, 'other_message': message.from !== username}"> | |
<span class="user_name">{{ message.from }}:</span><br> | |
<span>{{ message.text }}</span> | |
<div class="time">Lançado dia: {{message.created | date:'dd.MM hh:MM'}}</div> | |
</ion-item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addTodo() { | |
var d = new Date(); | |
var horas = d.getHours(); | |
var minutes = d.getMinutes(); | |
var seconds = d.getSeconds(); | |
var mm = d.getMonth() + 1; | |
var dd = d.getDate(); | |
var yy = d.getFullYear(); | |
var myDateString = 'Lançado dia: '+ dd + '/' + mm + '/' + yy + ' às ' + horas +':'+ minutes +':'+ seconds; | |
if (this.comment !== '') { | |
this.todos.push(myDateString); | |
this.todos.push(" + Comentário: "+ '\" ' + this.comment + ' \"'); | |
// Reset the variable of the input field | |
this.comment = ''; | |
}else{ | |
this.todos.push(myDateString); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket.on('add-message', (message) => { | |
io.emit('message', {text: message.text, from: socket.username, created: new Date()}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment