#286 Fix wrong year in changelog (fix #284)
Merged a year ago by nphilipp. Opened a year ago by music.
fedora-infra/ music/rpmautospec year-format  into  main

file modified
+1 -1
@@ -107,7 +107,7 @@ 

              return entry_info["data"]

  

          changelog_date = format_datetime(

-             entry_info["timestamp"], format="EEE MMM dd Y", locale="en"

+             entry_info["timestamp"], format="EEE MMM dd y", locale="en"

          )

  

          if entry_info["epoch-version"]:

The upper-case Y formats the ISO week year, which usually does not align with the calendar year around the new year. Correct the format string to prevent bogus dates in generated changelogs.

Fixes: https://pagure.io/fedora-infra/rpmautospec/issue/284

Example:

from babel.dates import format_datetime
import datetime as dt
print(format_datetime(dt.datetime(2023, 1, 1), format="EEE MMM dd Y", locale="en"))
print(format_datetime(dt.datetime(2023, 1, 1), format="EEE MMM dd y", locale="en"))

Example output:

Sun Jan 01 2022
Sun Jan 01 2023

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Looks good to me. The confusion was probably caused by babel.dates and datetime from Python standard library behaving differently ... %Y would be the correct specifier in the latter, but the capital Y has different meaning in babel:

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Seems fi-pre-commit is broken...

Seems fi-pre-commit is broken...

The problem is:

  - repo: https://gitlab.com/pycqa/flake8

flake8 is on Github now.

Good catch and thanks for helping out!

I'd like to have a test for this, but this also should get in soon (whatever this means in the context).

rebased onto 9332de7

a year ago

Build succeeded.

Pull-Request has been merged by nphilipp

a year ago
Metadata