Closed
Bug 149246
Opened 21 years ago
Closed 21 years ago
need to be able to specify relative dates in days
Categories
(Bugzilla :: Query/Bug List, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: michael, Assigned: michael)
References
Details
Attachments
(1 file, 3 obsolete files)
1.52 KB,
patch
|
jouni
:
review+
jouni
:
review+
|
Details | Diff | Splinter Review |
beeing able to specify relative dates allows savings of queries for the last week or periods back. syntax: -?\d+[dD] ("-20d" means 20 days back, "20D" the same)
Assignee | ||
Comment 1•21 years ago
|
||
Comment 2•21 years ago
|
||
-> patch author, keywords and stuff. Also proposing for consideration in 2.18.
Assignee | ||
Comment 3•21 years ago
|
||
this fix also supports relative dates in weeks, month, years and considers timezones.
Attachment #86387 -
Attachment is obsolete: true
Comment 4•21 years ago
|
||
Comment on attachment 88279 [details] [diff] [review] diff -u of buglist.cgi Tested only quickly and seemed to work, so I'll just post some review nits mostly about code readability: >+ my ($n, $u, $date) = ($1, lc $2, time); Please make those $n and $u something more verbose. Try $amount and $unit or something similar. >+ my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime($date); Be consistent: use spaces after commas here, too. $month instead of $mon, please? >+ $u='d', $n=7*$n+$wday if $u eq 'w'; # convert weeks to days .. >+ $year -= $n, $mon=0 if $u eq 'y'; >+ $mon -= $n if $u eq 'm'; Please rewrite these as "if $unit eq 'w' { ... }". >+ while($mon<0) {$year--; $mon += 12;} A space to separate the while and the (, and two more to separate the block contents from the braces around it. I hope that cuts it; I'll review again when I'm better awake. :-)
Assignee | ||
Comment 5•21 years ago
|
||
fixed review issues
Attachment #88279 -
Attachment is obsolete: true
Comment 6•21 years ago
|
||
Comment on attachment 88287 [details] [diff] [review] fixed review issues This is fine with me, though I'm not certain about how the relative month modifier should work. Currently if I type -2m now (on 20th June), I get bugs starting from May 2002. I can't say whether that's correct or not; the alternative (making the above testcase mean Apr 2002+) is not intuitively totally correct either. I think the most used option will be 'd' anyway, so we can fix those problems later. r=jouni; if somebody else has the time to come and take a look at this, that's great. If not, I'll give this the second r= eventually when some more testing has been done. I'll patch this into our own installation now.
Attachment #88287 -
Flags: review+
Assignee | ||
Comment 8•21 years ago
|
||
that patch allows relative dates in any date field in the query-page, so you could put "123d" in the date range field, and leave the other date range field "now". if desired I could patch the relative day code to do that to fix the 37749 and 43551 too.
Comment 9•21 years ago
|
||
No, bug 37749 is a sideeffect of how we handle the from/to stuff having the to variable be blank.
Comment 10•21 years ago
|
||
>if desired I could patch the relative day code to do that to fix the 37749 and
>43551 too.
Why not do that, but please don't embed the required fixes into this patch. This
is already very close to checkin, and we wouldn't want to delay it. Make another
patch on the top of this if necessary and attach it to the relevant bug.
Updated•21 years ago
|
Attachment #88287 -
Flags: review+
Comment 11•21 years ago
|
||
Comment on attachment 88287 [details] [diff] [review] fixed review issues Okay, 2xr=jouni then. I'll check this in soon.
Comment 12•21 years ago
|
||
*** Bug 156411 has been marked as a duplicate of this bug. ***
Comment 13•21 years ago
|
||
Checked into the trunk. Thanks for the patch, Michael! Checking in buglist.cgi; /cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v <-- buglist.cgi new revision: 1.181; previous revision: 1.180 done
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 14•21 years ago
|
||
*** Bug 175237 has been marked as a duplicate of this bug. ***
Comment 15•21 years ago
|
||
*** Bug 177697 has been marked as a duplicate of this bug. ***
Comment 16•21 years ago
|
||
The functionality won't be very useful if you don't know it's there, so here's some simple UI modifications.
Comment 17•21 years ago
|
||
anthony@itia.ntua.gr: Please file another bug if you consider UI changes necessary. This one is already fixed, and any patches posted to closed bugs are bound to be easily forgotten.
Comment 18•21 years ago
|
||
Comment on attachment 116467 [details] [diff] [review] UI changes OK, sorry, I filed the new bug 196373.
Attachment #116467 -
Attachment is obsolete: true
Updated•11 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•