+sub days_between {
+ my $self = shift;
+ my $start_dt = shift;
+ my $end_dt = shift;
+ $start_dt->truncate( to => 'hours' );
+ $end_dt->truncate( to => 'hours' );
+
+ # start and end should not be closed days
+ my $duration = $end_dt - $start_dt;
+ $start_dt->truncate( to => 'days' );
+ $end_dt->truncate( to => 'days' );
+ while ( DateTime->compare( $start_dt, $end_dt ) == -1 ) {
+ $start_dt->add( days => 1 );
+ if ( $self->is_holiday($start_dt) ) {
+ $duration->subtract( days => 1 );
+ }
+ }
+ return $duration;
+
+}
+