1 package FS::part_event::Condition::day_of_month;
4 use base qw( FS::part_event::Condition );
7 "Run only on a certain day of the month",
12 'day' => { label => 'Day (1-28, separate multiple days with commas)',
18 sub condition { # is this even necessary? condition_sql is exact.
19 my( $self, $object, %opt ) = @_;
21 my $today = (localtime($opt{'time'}))[3];
22 if (grep { $_ == $today } split(',', $self->option('day'))) {
29 my( $class, $table, %opt ) = @_;
30 my $today = (localtime($opt{'time'}))[3];
31 my $day = $class->condition_sql_option('day');
32 if ($opt{'driver_name'} eq 'Pg') {
33 "$today = ANY( string_to_array($day, ',')::integer[] )";
34 } elsif ( $opt{'driver_name'} eq 'mysql' ) {
35 "find_in_set($today, $day) > 0";