Modmail icon indicating copy to clipboard operation
Modmail copied to clipboard

Unexpected "This time is in the past."

Open robinmahieu opened this issue 7 years ago • 9 comments

When trying to close a thread in x amount of hours, this error pops up sometimes.

Image

robinmahieu avatar May 31 '19 17:05 robinmahieu

I have tested with one thread, I was able to get it to work when using no space and h instead of hour all others gave this error.

?close in 1 hours This thread has been closed due to inactivity, please contact us again if you have any issues/queries. Error Presented

?close 1hour This thread has been closed due to inactivity, please contact us again if you have any issues/queries. Error Presented

?close 1h This thread has been closed due to inactivity, please contact us again if you have any issues/queries. Worked as expected

I am still testing various things to see what causes this error and what does not

StephenDaDev avatar May 31 '19 23:05 StephenDaDev

Adding to my previous testing, the "day" timeframe seems to work fine.

?close 1 day Worked as expected ?close 1 days Worked as expected ?close 1d Worked as expected

and With minutes:

?close 1 minute Worked as expected ?close 1 minutes Worked as expected ?close 1m Worked as expected

It appears it is currently only the "hour" that is messed up.

StephenDaDev avatar Jun 01 '19 03:06 StephenDaDev

It might be due to the message afterwards that's causing the error

0arm avatar Jun 01 '19 04:06 0arm

Any updates on this?

StephenDaDev avatar Aug 23 '19 18:08 StephenDaDev

I ran a few tests, the issue appears to be with self.dt. (Line 198 of time.py is a good jumping off point)

The times looked like this for ?close 1h (correct): now: 2019-08-23 18:43:52.624895 self.dt: 2019-08-23 19:43:52.624895

While for ?close in 1 hours (incorrect): now: 2019-08-23 18:43:28.221410 self.dt: 2019-08-23 18:43:28

Weirdllamas avatar Aug 23 '19 18:08 Weirdllamas

Nvm, i was super wrong. But yeah, it appears to be the message afterwards

Weirdllamas avatar Aug 23 '19 19:08 Weirdllamas

Fixing this can not easily be done due to the current parsing logic. Right now, there are two options imo, we’ll advance from the poll results:

Option 1: Keep the current method of parsing (which allows more fluent time such as ~~“in 3 minutes before midnight”~~ too buggy right now so doesn’t work) and slowly improve upon it, offers flexibility.

Option 2: Switch to limiting only certain time formats (ex. “25d7m”, “12 mins 4 secs”, etc.), changing to this will fix a lot of the current time issues, offers slightly less flexibility.

Option 3: Other, comment down below.

Taaku18 avatar Sep 12 '19 16:09 Taaku18

Option 3: Shift to dateparser ;p

whopiyush avatar Jan 15 '20 12:01 whopiyush

This issue is stale because it has been open for 100 days with no activity. Remove stale label or comment or this will be closed in 5 days. Please do not un-stale this issue unless it carries significant contribution.

github-actions[bot] avatar Apr 25 '20 00:04 github-actions[bot]