Skip to content

Conversation

@duartegalvao
Copy link
Member

This PR is a follow-up to #6887.

While the registration data is now a Date object in Excel, the configured format doesn’t follow the configured format in the field. For instance, date fields that are configured as YYYY appear in Excel as 2025-01-01.

The PR configures those Date cells in Excel the same format configure in the registration form field. The formats are passed to send_xlsx via a new optional argument that takes a mapping of header->format. generate_xlsx then adds the mappings to the workbook and applies it to the cells of each respective column.

Happy Halloween 🎃

@duartegalvao duartegalvao force-pushed the fix-registration-date-export branch from dbf5e26 to e0fd298 Compare November 10, 2025 11:47
@ThiefMaster ThiefMaster added this to the v3.3 milestone Nov 10, 2025
@ThiefMaster ThiefMaster enabled auto-merge (squash) November 10, 2025 14:44
@ThiefMaster ThiefMaster merged commit e93b277 into indico:master Nov 10, 2025
10 checks passed
@ThiefMaster ThiefMaster deleted the fix-registration-date-export branch November 10, 2025 14:47
bold = workbook.add_format({'bold': True})
wb_formats = {
fmt: workbook.add_format({'num_format': _strftime_to_excel_number_format(fmt)})
for fmt in {value for value in column_formats.values() if value}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks when no column_format are specified... ie in any excel export that's not registrations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(fixed in master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants