title: Firebase use endAt if timestamp field
body: <p>I have records with this fields:</p>
  
  <pre><code>age: 25
  timestamp: 1484089199472
  </code></pre>
  
  <p>This records inserted by:</p>
  
  <pre><code>@Exclude
  public Map&lt;String, Object&gt; toMap() {
      HashMap&lt;String, Object&gt; result = new HashMap&lt;&gt;();
  
      result.put("age", age);
      result.put("timestamp", ServerValue.TIMESTAMP);
      return result;
  }
  </code></pre>
  
  <p>If i use <code>endAt(24,"age")</code> than its work good, the item is invisible.</p>
  
  <p>But if i want to use endAt in timestamp its not work. For example:
  <code>endAt(100000,"timestamp")</code> and the row is stay visible.
  Why? </p>
  
  <p>This is check the type? </p>
  
  <p>How can i filter it?</p>
  
  <p>I dont have any idea! :( 
  I hope someone can help me!
  Thanks!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Query for get the actually day rows</p>
  
  <pre><code> @Override
      public Query getQuery(final DatabaseReference databaseReference) {
          Date endTime = new Date();
          endTime.setHours(23);
          endTime.setMinutes(59);
          endTime.setSeconds(59);
  
          return databaseReference
                  .child("toplist")
                  .endAt(endTime.getTime(),"timestamp")
                  .orderByChild("point")
                  .limitToFirst(50);
  
      }
  </code></pre>
  
  <p>Data</p>
  
  <pre><code>@IgnoreExtraProperties
  public class Rank{
  
      public int number;
      public String username;
      public int point;
  
  
      // [START post_to_map]
      @Exclude
      public Map&lt;String, Object&gt; toMap() {
          HashMap&lt;String, Object&gt; result = new HashMap&lt;&gt;();
          result.put("number", number);
          result.put("username", username);
          result.put("point", point);
          result.put("timestamp", ServerValue.TIMESTAMP);
          return result;
      }
  
  }
  </code></pre>
  
  <p>Add new random item</p>
  
  <pre><code>private void writeNewRandomTopListItem() {
          Random rnd = new Random();
          Rank item = new Rank();
          item.username = "Test " + rnd.nextInt(20000);
          item.point = rnd.nextInt(2000000);
  
          mDatabase.child("toplist").push().setValue(item.toMap());
      }
  </code></pre>
  
  <p>Adapter</p>
  
  <pre><code>Query postsQuery = getQuery(mDatabase);
          mAdapter = new FirebaseRecyclerAdapter&lt;Rank, PostViewHolder&gt;(Rank.class, R.layout.item_post, PostViewHolder.class, postsQuery) {
              @Override
              protected void populateViewHolder(final PostViewHolder viewHolder, final Rank model, final int position) {
  
                  viewHolder.bindToPost(model,position);
              }
          };
          mRecycler.setAdapter(mAdapter);
  </code></pre>
  
  <p>...</p>
  
  <pre><code> toplist
     -Ka8m3hN-vRjPZhKH3Rt
       number: 0
       point:  1269424
       timestamp: 148407253222471
       username:  "Test 19727"
     -Ka8m3hWRIQKL7faNqUS
       number:  0
       point:  1398061
       timestamp:  1484075322472
       username: "Test 17679"
  </code></pre>