mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 10:48:06 -05:00
format and time zone. #6586 was reopened for what the first fix left, and every point of it was a symptom of one thing: the PDF export of a card had grown separately from the Excel export of the same card. "Assignee, Labels, due,... these titels should be in the user set language" - the labels were hard-coded English, and not even consistent with each other: the card export wrote "Due: " while the board export wrote "due" with no colon. Both exports now build every label from the same i18n keys, in the language the request carries, through one field() helper that writes every "Label: value" - so the two cannot drift apart again. Every key carries its English text as the fallback, so a missing translation shows the word and never the key. "I think all those other things we set in a card should be also present" - both exports now carry title, labels, creator, assignees, members, board, swimlane, list, card number, requested by, assigned by, the six dates, spent time, description, custom fields, checklists, subtasks, comments, attachments, voting and Planning Poker, in that order. Custom fields, voting and poker are new on BOTH sides; they are appended to ALL_FIELDS rather than inserted, so a saved ?fields= link still asks for what it always asked for, and they are checkboxes in the export popup like the rest. "the time is not in the user set timezone (-2h wrong for Europe/Berlin)" - it was worse than -2h: the PDF printed UTC and the Excel export printed whatever zone the server was started in. Dates are stored in UTC and a profile carries no zone, so the export links now send the browser's IANA zone and the date format the OPENED CARD is showing - which for a logged-out reader lives in localStorage, where no server-side lookup reaches it. Both exports format through formatDateByUserPreference, which gained an optional zone; without one it still renders in the process zone, which is what every client-side caller wants. A server-built export given no zone renders UTC and says UTC. Verified: 12:00Z prints 14:00 for Europe/Berlin, 00:00 on the 15th for Pacific/Auckland, and an unknown zone falls back instead of failing. "would it make sense to support markdown formated text in description" - a description is now cut into runs and drawn in the four base-14 Courier faces, so **bold**, *italic* and ***both*** are bold, italic and both. Consecutive Tj operators continue at the current text position, so a font switch needs no glyph measuring. Strikethrough and inline code keep their words and lose their markers - a Type1 base-14 font has no strike and there is no fifth face for code - and an underscore inside a word stays an underscore. tests/cardExportParity.test.cjs pins the shared field list, keys, formatter and request params; tests/pdfExport.test.cjs gains the runs, the wrapping and the four declared faces. Two of its guards moved rather than being deleted: they pinned the hard-coded English "Labels: " and "due", which is the behaviour that deliberately changed, and they now pin that both come from the same keys. Thanks to Heart1010 and xet7 ! Fixes #6586,