Skip to content

Commit

Permalink
cleaned Code
Browse files Browse the repository at this point in the history
  • Loading branch information
LuBroering committed Nov 28, 2023
1 parent a50e3a2 commit 1e78748
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Kernel/System/Calendar/Appointment.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2376,17 +2376,17 @@ sub _AppointmentRecurringCreate {
my $EndDSTDiff = $EndTimeObject->CompareDST($OriginalEndTimeObject);
my $CurrentStartTimeObject = $StartTimeObject->Clone();
my $CurrentEndTimeObject = $EndTimeObject->Clone();
if ( $StartDSTDiff ) {
if ( IsPositiveInteger($StartDSTDiff) ) {
if ( IsInteger( $StartDSTDiff ) ) {
if ( $StartDSTDiff > 0 ) {
$CurrentStartTimeObject->Subtract( Seconds => $StartDSTDiff );
}
elsif ( $StartDSTDiff < 0 ) {
$CurrentStartTimeObject->Add( Seconds => ($StartDSTDiff * -1));
}
$StartTime = $CurrentStartTimeObject->ToString();
}
if ( $EndDSTDiff ) {
if ( IsPositiveInteger($EndDSTDiff) ) {
if ( IsInteger($EndDSTDiff) ) {
if ( $EndDSTDiff > 0 ) {
$CurrentEndTimeObject->Subtract( Seconds => $EndDSTDiff );
}
elsif ( $EndDSTDiff < 0 ) {
Expand Down
4 changes: 1 addition & 3 deletions Kernel/System/DateTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2242,9 +2242,7 @@ sub _OpNotEquals {

sub CompareDST {
my ($Self, $OtherDateTimeObject) = @_;
my $TimeDif = $Self->{CPANDateTimeObject}->offset - $OtherDateTimeObject->{CPANDateTimeObject}->offset;

return $TimeDif;
return $Self->{CPANDateTimeObject}->offset - $OtherDateTimeObject->{CPANDateTimeObject}->offset;
}
1;

Expand Down

0 comments on commit 1e78748

Please sign in to comment.