Query dateranges with day-to-month-in-year granularity
Change-Id: Idea73854cc17b8e67b536fdf7b8ae40080f1051e
diff --git a/lib/Krawfish/Koral/Corpus/Field/Date.pm b/lib/Krawfish/Koral/Corpus/Field/Date.pm
index cba1832..bd056a8 100644
--- a/lib/Krawfish/Koral/Corpus/Field/Date.pm
+++ b/lib/Krawfish/Koral/Corpus/Field/Date.pm
@@ -198,25 +198,25 @@
# 2005-07-14--2005-11
# 2005-07-14--2005-11-20
- # foreach my $month ($from->month + 1 .. $to->month - 1) {
- # push @terms, $self->term_all(
- # $self->new_to_value_string(
- # $from->year, $month
- # )
- # );
- # };
+ foreach my $month ($from->month + 1 .. $to->month - 1) {
+ push @terms, $self->term_all_or_part(
+ $self->new_to_value_string(
+ $from->year, $month
+ )
+ );
+ };
# No day defined
# 2005-07-14--2005-11
-# unless ($to->day) {
-# # Store the current month as all
-# push @terms, $self->term_all(
-# $self->new_to_value_string(
-# $to->year, $to->month
-# )
-# );
-# return @terms;
-# };
+ unless ($to->day) {
+ # Get the current month as part
+ push @terms, $self->term_all_or_part(
+ $self->new_to_value_string(
+ $to->year, $to->month
+ )
+ );
+ return @terms;
+ };
# 2005-07-14--2005-11-20
}