Skip to content

Commit 690ed73

Browse files
committed
Move the relative date docs downward
It's important to introduce the .. syntax before we get here.
1 parent eaae3fb commit 690ed73

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

docs/reference/query.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -164,28 +164,6 @@ Dates are written separated by hyphens, like ``year-month-day``, but the month
164164
and day are optional. If you leave out the day, for example, you will get
165165
matches for the whole month.
166166

167-
You can also use relative dates to the current time.
168-
It looks like ``-3w``, ``2m`` or ``-4d`` which means the date 3 weeks ago,
169-
the date 2 months from now and the date 4 days ago.
170-
A relative date consists of three parts:
171-
- ``+`` or ``-`` sign is optional and defaults to ``+``. The ``+`` sign will
172-
add a time quantity to the current date while the ``-`` sign will do the
173-
opposite
174-
- a number follows and indicates the amount to add or substract
175-
- a final letter ends and represents the amount in either days, weeks, months or
176-
years (``d``, ``w``, ``m`` or ``y``)
177-
178-
Please note that this relative calculation makes the assumption of 30 days per
179-
month and 365 days per year.
180-
181-
Here is an example that finds all the albums added between now and last week::
182-
183-
$ beet ls -a 'added:-1w..'
184-
185-
Find all items added in a 2 weeks period 4 weeks ago::
186-
187-
$ beet ls -a 'added:-6w..-4w'
188-
189167
Date *intervals*, like the numeric intervals described above, are separated by
190168
two dots (``..``). You can specify a start, an end, or both.
191169

@@ -239,6 +217,28 @@ queries do the same thing::
239217
$ beet ls 'added:2008-12-01t22:45:20'
240218
$ beet ls 'added:2008-12-01 22:45:20'
241219

220+
You can also use relative dates to the current time.
221+
It looks like ``-3w``, ``2m`` or ``-4d`` which means the date 3 weeks ago,
222+
the date 2 months from now and the date 4 days ago.
223+
A relative date consists of three parts:
224+
- ``+`` or ``-`` sign is optional and defaults to ``+``. The ``+`` sign will
225+
add a time quantity to the current date while the ``-`` sign will do the
226+
opposite
227+
- a number follows and indicates the amount to add or substract
228+
- a final letter ends and represents the amount in either days, weeks, months or
229+
years (``d``, ``w``, ``m`` or ``y``)
230+
231+
Please note that this relative calculation makes the assumption of 30 days per
232+
month and 365 days per year.
233+
234+
Here is an example that finds all the albums added between now and last week::
235+
236+
$ beet ls -a 'added:-1w..'
237+
238+
Find all items added in a 2 weeks period 4 weeks ago::
239+
240+
$ beet ls -a 'added:-6w..-4w'
241+
242242
.. _not_query:
243243

244244
Query Term Negation

0 commit comments

Comments
 (0)