GreenFairy.CQL.Scalars.DateTime.PeriodUnit (GreenFairy v0.3.0)
View SourceEnum for time period units in date/time filtering.
Used with _period and _current_period operators to specify
the granularity of time-based filtering.
Values
:hour- Hour period:day- Day period:week- Week period (Monday to Sunday by default, configurable):month- Calendar month period:quarter- Quarter period (3 months: Q1=Jan-Mar, Q2=Apr-Jun, Q3=Jul-Sep, Q4=Oct-Dec):year- Calendar year period
Examples
# Current week
%{unit: :week}
# Last 30 days
%{direction: :last, unit: :day, count: 30}
# This quarter
%{unit: :quarter}
Summary
Functions
Transform an Ecto/database value to its GraphQL enum representation.
Transform a GraphQL enum value to its Ecto/database representation.
Functions
Transform an Ecto/database value to its GraphQL enum representation.
Default implementation returns the value unchanged. Override this function to provide custom transformations.
Transform a GraphQL enum value to its Ecto/database representation.
Default implementation returns the value unchanged. Override this function to provide custom transformations.