Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Export Agenda with AGENDA_EXPORT_FIX_TZ for Holidays #21495

Closed
comaiteseb opened this issue Jul 11, 2022 · 0 comments · Fixed by #21496
Closed

Error Export Agenda with AGENDA_EXPORT_FIX_TZ for Holidays #21495

comaiteseb opened this issue Jul 11, 2022 · 0 comments · Fixed by #21496
Labels
Bug This is a bug (something does not work as expected)

Comments

@comaiteseb
Copy link
Contributor

Bug

When I'm exporting the calendar in any format (ics, caldav...) if I set a value on the AGENDA_EXPORT_FIX_TZ parameter, the exported date is 1969-12-31

Environment Version

15.0 & 16.0

Environment OS

Linux

Environment Web server

Apache

Environment PHP

php 7.4

Environment Database

Mysql 8

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

There is a solution with a patch:
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index a5c8a11..c5d3fc5 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -2065,8 +2065,8 @@ class ActionComm extends CommonObject
}

                                            if (!empty($conf->global->AGENDA_EXPORT_FIX_TZ)) {
  •                                                   $timestampStart = - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
    
  •                                                   $timestampEnd   = - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
    
  •                                                   $timestampStart = $timestampStart- ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
    
  •                                                   $timestampEnd   = $timestampEnd - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
                                              }
    
@comaiteseb comaiteseb added the Bug This is a bug (something does not work as expected) label Jul 11, 2022
comaiteseb added a commit to comaiteseb/dolibarr that referenced this issue Jul 11, 2022
eldy pushed a commit that referenced this issue Jul 12, 2022
comaiteseb added a commit to comaiteseb/dolibarr that referenced this issue Jul 19, 2022
FIX Dolibarr#21495

Error when calculate the date when AGENDA_EXPORT_FIX_TZ is set.
The resulting date is 1969-12-31
eldy added a commit that referenced this issue Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant