# Before and after are not implemented right in search

**URL:** https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515
**Category:** Bug
**Created:** [July 17, 2018, 4:46am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515 "2018-07-17T04:46:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [July 17, 2018, 4:46am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515/1 "2018-07-17T04:46:00Z")

</div>

@Gunnar is travelling today, so it will be a while until he can provide that info.

A search for “after:2018-07-18” (i.e. after tomorrow) still yields the same 37 hits.

I also noticed that opening the link here:

> [@JagWaugh](#):
>
> Seaching for “future” posts gives 37 hits at the moment: [Search results for ‘after:2018-07-16’ - Jag-lovers Forums](https://forums.jag-lovers.com/search?expanded=true&q=after%3A2018-07-16) (That might explain why they don’t show up in “latest” or “new”.

Changes it from “after” to “before”, which I presume is an unrelated bug.

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/7/97d32fe750c3fc6267520a0f3d00c00ba4964d68.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 17, 2018, 4:49am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515/2 "2018-07-17T04:49:21Z")

</div>

Yeah this is pretty dodge… back in the day my implementation was `after:5` and `before:5` where 5 is the number of days ago.

Somehow a date snuck in … somehow the advanced UI gets confused between before and after.

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [July 17, 2018, 4:55am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515/3 "2018-07-17T04:55:00Z")

</div>

It shows as the screen shot when the tab opens, hitting refresh doesn’t change anything, but hitting the search button then back corrects it.

EDIT (not enough coffee yet): The list of hits that it lands with, before clicking anything, is apparently correct.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 23, 2018, 6:08am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515/4 "2018-08-23T06:08:33Z")

</div>

5 posts were merged into an existing topic: [Post date oddities, search](https://meta.discourse.org/t/post-date-oddities-search/92384/13)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 23, 2018, 6:07am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515/9 "2018-08-23T06:07:53Z")

</div>

Fixed in

[https://github.com/discourse/discourse/commit/bd66fbef7fd6d6259bedc37295b1174f6e3771c9](https://github.com/discourse/discourse/commit/bd66fbef7fd6d6259bedc37295b1174f6e3771c9)

Thanks for reporting @JagWaugh

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 23, 2018, 6:08am UTC](https://meta.discourse.org/t/before-and-after-are-not-implemented-right-in-search/92515/10 "2018-08-23T06:08:49Z")

</div>


