@@ -150,106 +150,136 @@ Filter Date Fields
150150When you drag a date field to the filter panel, you can filter based
151151on a specified date range. This range can either be:
152152
153- - A :ref:` relative date <relative-date>` range, which specifies a range
153+ - A relative date range, which specifies a range
154154 relative to the time the chart is rendered (e.g., the last six
155155 months).
156156
157- - An :ref:` absolute date <absolute-date>` range, which is a range
157+ - An absolute date range, which is a range
158158 between specific beginning and end dates.
159159
160- .. _relative- date:
160+ Select the appropriate tab for more information on the date filter :
161161
162- Relative Date Filter
163- ````````````````````
162+ .. tabs::
164163
165- Relative date filters specify a range relative to the
166- time the chart is rendered. To define the date range, specify a period
167- of time in the past and/or a period of time in the future relative to
168- the current date. :guilabel:`Relative` is the default date filtering
169- option.
164+ .. tab:: Relative Date Filter
165+ :tabid: relative-date
170166
171- To set a lower bound for a relative date filter:
167+ Relative date filters specify a range relative to the
168+ time the chart is rendered. To define the date range, specify a period
169+ of time in the past and/or a period of time in the future relative to
170+ the current date. :guilabel:`Relative` is the default date filtering
171+ option.
172172
173- 1. Turn on the :guilabel:`From` toggle.
173+ .. list-table::
174+ :header-rows: 1
174175
175- #. Set the lower bound for your relative date. This timespan is
176- relative to the current date.
176+ * - To set a lower bound for the date filter:
177+ - To set an upper bound for the date filter:
177178
178- To set an upper bound for a relative date filter:
179+ * - 1. Turn on the :guilabel:`From` toggle.
179180
180- 1. Turn on the :guilabel:`Until` toggle.
181+ #. Set the lower bound for your relative date. This
182+ timespan is relative to the current date.
181183
182- #. Set the upper bound for your relative date. This timespan is
183- relative to the current date.
184+ - 1. Turn on the :guilabel:`Until` toggle.
184185
185- .. example::
186+ #. Set the upper bound for your relative date. This
187+ timespan is relative to the current date.
186188
187- The following relative date filter only shows documents
188- with a ``Workout Date (As Date)`` field that is more recent than one year
189- ago from the current date:
189+ .. example::
190190
191- .. figure:: /images/charts/ relative- date.png
192- :scale: 100%
193- :alt: Image showing relative date filter
191+ The following relative date filter only shows documents
192+ with a ``Workout Date (As Date)`` field that is more recent than one year
193+ ago from the current date:
194194
195- .. _absolute-date:
195+ .. figure:: /images/charts/relative-date.png
196+ :scale: 100%
197+ :alt: Image showing relative date filter
196198
197- Absolute Date Filter
198- ````````````````````
199+ .. tab:: Absolute Date Filter
200+ :tabid: absolute-date
199201
200- Absolute date filters use absolute dates to define their upper and lower
201- bounds. To define an absolute date range, select :guilabel:`Absolute`
202- at the top of your date filter card. The dates specified in the filter
203- are assumed to be in :abbr:`UTC (Coordinated Universal Time)`, matching
204- the raw data in the collection.
202+ Absolute date filters use absolute dates to define their upper and lower
203+ bounds. To define an absolute date range, select :guilabel:`Absolute`
204+ at the top of your date filter card. By default, the dates specified in the filter
205+ are assumed to be in :abbr:`UTC (Coordinated Universal Time)`, matching
206+ the raw data in the collection. You can
207+ specify a timezone for your filter to adjust the date values as
208+ desired.
205209
206- To define a lower bound for your absolute date filter:
210+ .. list-table::
211+ :header-rows: 1
207212
208- 1. Turn on the :guilabel:`From` toggle.
213+ * - To set a lower bound for the date filter:
214+ - To set an upper bound for the date filter:
209215
210- #. Enter a date for your lower bound, or
211- select a date from the calendar below the input field.
216+ * - 1. Turn on the :guilabel:`From` toggle.
212217
213- #. Enter a time for your lower bound, or select a time
214- from the list below the input field.
218+ #. Enter a date for your lower bound, or
219+ select a date from the calendar below the input field.
215220
216- #. Set :guilabel:`Inclusive` to dictate whether to include
217- the specified date .
221+ #. Enter a time for your lower bound, or select a time
222+ from the list below the input field .
218223
219- To define an upper bound for your absolute date filter:
224+ #. Set :guilabel:`Inclusive` to dictate whether to include
225+ the specified date.
220226
221- 1. Turn on the :guilabel:`To` toggle.
227+ - 1. Turn on the :guilabel:`To` toggle.
222228
223- #. Enter a date for your upper bound, or
224- select a date from the calendar below the input field.
229+ #. Enter a date for your upper bound, or
230+ select a date from the calendar below the input field.
225231
226- #. Enter a time for your upper bound, or select a time
227- from the list below the input field.
232+ #. Enter a time for your upper bound, or select a time
233+ from the list below the input field.
228234
229- #. Set :guilabel:`Inclusive` to dictate whether to include
230- the specified date.
235+ #. Set :guilabel:`Inclusive` to dictate whether to include
236+ the specified date.
231237
232- .. example ::
238+ .. note ::
233239
234- The following absolute date filter only shows documents
235- with a ``Workout Date (As Date)`` field from the year
236- ``2018``:
240+ The date and time formats used in your bounds depend
241+ on your location, as determined from your browser settings.
237242
238- .. figure:: /images/charts/absolute-date.png
239- :scale: 100%
240- :alt: Image showing absolute date filter
243+ .. example::
241244
242- |
245+ The following absolute date filter only shows documents
246+ with a ``Workout Date (As Date)`` field from the year
247+ ``2018``:
243248
244- The filter returns all documents with a
245- ``Workout Date (As Date)`` field from ``January 1, 2018 12:00:00
246- AM`` inclusively, to ``January 1, 2019 12:00:00 AM`` exclusively.
249+ .. figure:: /images/charts/absolute-date.png
250+ :scale: 60%
251+ :alt: Image showing absolute date filter
247252
248- .. note::
253+ |
254+
255+ The filter returns all documents with a
256+ ``Workout Date (As Date)`` field from ``January 1, 2018 12:00:00
257+ AM`` inclusively, to ``January 1, 2019 12:00:00 AM`` exclusively.
258+
259+ Specify a Time Zone
260+ ```````````````````
261+
262+ Use the :guilabel:`Time Zone` dropdown at the bottom of the
263+ filter card to specify a time zone for your absolute date filter.
264+
265+ By default, MongoDB stores date values in
266+ :abbr:`UTC (Coordinated Universal Time)`. When you change the
267+ time zone, |charts-short| modifies your date values with respect
268+ to the selected time zone. As a result, different documents may be
269+ returned by your absolute date filter depending on the time
270+ zone selected.
271+
272+ .. example::
249273
250- The date and time formats used in your bounds depend
251- on your location, as determined from your browser settings.
252-
274+ Consider an absolute date filter which spans from
275+ January 1, 2018 12:00:00 AM inclusively to
276+ January 1, 2019 12:00:00 AM exclusively. By default, a
277+ document with a UTC date of January 1, 2019 2:00:00 AM
278+ would not be included in this date range. However, if we
279+ adjust the time zone to
280+ :guilabel:`Central America (UTC-06:00)`, this document
281+ would be returned because the adjusted date is
282+ December 31, 2018 8:00:00 PM.
253283
254284.. _filter-boolean:
255285
0 commit comments