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

the updated_on value is missing the tzinfo (naive datetime object) #271

Closed
dpocock opened this issue Mar 18, 2021 · 2 comments
Closed

the updated_on value is missing the tzinfo (naive datetime object) #271

dpocock opened this issue Mar 18, 2021 · 2 comments
Assignees
Labels

Comments

@dpocock
Copy link

dpocock commented Mar 18, 2021

tested with the Debian package version 2.2.1-1 and Redmine 3.3.1-4+deb9u2, PostgreSQL backend

Here is the workaround I'm using in my code:

            # FIXME - why doesn't this already have tzinfo from the API?
            last_modified = issue['updated_on']
            if last_modified.tzinfo is None:
                app.logger.debug("ticket #%s: Redmine API updated_on value has no timezone, assuming UTC" % (issue['id'],))
                last_modified = last_modified.replace(tzinfo=datetime.timezone.utc)
            todo['last-modified'] = icalendar.vDatetime(last_modified)
@maxtepkeev maxtepkeev self-assigned this Apr 12, 2021
@maxtepkeev
Copy link
Owner

That can be a nice feature to add, thanks for the idea.

maxtepkeev added a commit that referenced this issue Jan 5, 2023
@maxtepkeev
Copy link
Owner

Implemented in 517af43. Will be released in next version. Once again thanks for the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants