M
M
Morerion2017-07-18 12:19:11
typescript
Morerion, 2017-07-18 12:19:11

How to save date on Firebase (AngularFire2)?

I ran into a problem, when trying to save the date on firebase, it is simply ignored and everything except it is saved, I write on AngularFire2, what should I do? How to save the date? Maybe it can somehow be translated into a string... Help! Thank you!

investb(task:string) {
  console.log(task);
  // sfdsdfsdd = nick
  let sfdsdfsdd = jQuery('.hdsuhudsf').text();
  let nows = new Date();
  console.log(nows);
  console.log(sfdsdfsdd);
  if(task == ''){
    Materialize.toast('Error' , 1000);
    console.log('test2');
  }else{
    Materialize.toast('Ваша заявка отправлена!', 3000, 'green');
    console.log('test3');
    //  Нужно сохранить время (переменная nows)
    this.af.database.list('tasks').push({ task: task,status:'naw', nick: sfdsdfsdd, time:nows, test:'test' });
    console.log('test4');
  }
}

1d8c72db82894f52a53434a700a43412.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question