Comparison Operators for date_xx

# S3 method for date_xx
Ops(e1, e2)

Arguments

e1, e2

Objects with the same date_xx subclass (one of them can also be integer)

Value

a logical scalar

Examples

date_yq(2015, 1) < date_yq(2015, 2)
#> [1] TRUE
# comparison with integers is ok date_yq(2015, 1) < 20152
#> [1] TRUE
# but two different date_xx cannot be compared try(date_yq(2015, 1) < date_ym(2015, 2))
#> Error : Comparison of <date_xx> is only defined if both objects have the same subclass, but 'e1' is <date_yq> and 'e2' is <date_ym>