SHARE
TWEET

Untitled

a guest Aug 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //ultimos eventos
  2.     var now = moment();
  3.     var endDate = now.format("x"); //data atual em unix
  4.     var startDate = now.subtract(10,'hours').format("x");
  5.  
  6.     console.log(startDate);
  7.     console.log(endDate);
  8.  
  9.     var uv = this.af.list('/pedidos/', ref => ref.orderByChild('now').startAt(startDate).endAt(endDate));
  10.     uv.snapshotChanges().pipe(
  11.  
  12.       map(actions =>
  13.         actions.map(a => ({key:a.key, ...a.payload.val()}))
  14.        
  15.         )
  16.     )
  17.  
  18.     .subscribe(items =>{
  19.  
  20.       this.ultimosEventos = items;
  21.       console.log(items);
  22.  
  23.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top