From af4a307e99fdcd2ddc9615442d975edfc6a2b700 Mon Sep 17 00:00:00 2001 From: Marco Hagspiel <154801544+Hagma2023@users.noreply.github.com> Date: Sun, 25 Oct 2026 15:00:06 +0100 Subject: [PATCH] M7: dotted day-first dates in header and footer (#4503) Header and footer dates had US, ISO and day-first slash forms only. The dotted forms written in German-speaking and much of Central and Eastern Europe join them: <>, <>, <>, <>. The dialog's date list offers the first three after the existing ones. Generated with Claude Code Signed-off-by: Marco Hagspiel Co-authored-by: Marco Hagspiel Co-authored-by: Claude --- crates/automation/src/tools.rs | 2 +- crates/edit/src/lib.rs | 8 +++++++- crates/edit/src/tests.rs | 1 + crates/ui-egui/src/marks_ui.rs | 15 +++++++++++++-- parity/acrobat-features.toml | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/crates/automation/src/tools.rs b/crates/automation/src/tools.rs index 01c57fdaa..6adce237c 100644 --- a/crates/automation/src/tools.rs +++ b/crates/automation/src/tools.rs @@ -956,7 +956,7 @@ pub fn tools() -> Vec { t( "doc_header_footer", "Add header and footer", - "Add a header and/or footer to pages. Text boxes: header_left/center/right, footer_left/center/right. Tokens: <<1>> page number, <> page count, <<1 of n>>, <>, <<1/n>>, dates <> <> <> (and more), Bates <>. shrink: true scales the page content down evenly into the room the header and footer leave free, so they don't cover it. font: Helvetica (default), Times or Courier. replace: true swaps out existing ones (Update). Undoable.", + "Add a header and/or footer to pages. Text boxes: header_left/center/right, footer_left/center/right. Tokens: <<1>> page number, <> page count, <<1 of n>>, <>, <<1/n>>, dates <> <> <> <> (and more), Bates <>. shrink: true scales the page content down evenly into the room the header and footer leave free, so they don't cover it. font: Helvetica (default), Times or Courier. replace: true swaps out existing ones (Update). Undoable.", ) .cmd("edit.header_footer") .with(schema( diff --git a/crates/edit/src/lib.rs b/crates/edit/src/lib.rs index 630f12550..f324a565e 100644 --- a/crates/edit/src/lib.rs +++ b/crates/edit/src/lib.rs @@ -57,7 +57,9 @@ pub struct HeaderFooter { /// Left, centre and right header text, then left, centre and right footer text. Tokens: /// `<<1>>` page number, `<>` page count, `<<1 of n>>`, `<<1/n>>`, `<>`, /// `<>`, dates `<>`, `<>`, `<>`, `<>`, - /// `<>`, `<>`, `<>`, `<>`, and Bates numbers `<>` + /// `<>`, `<>`, `<>`, `<>`, the dotted day-first + /// dates of German-speaking and much of Central and Eastern Europe `<>`, + /// `<>`, `<>`, `<>`, and Bates numbers `<>` /// (digits, start, prefix, suffix). pub text: [String; 6], /// The standard face the text is drawn in (#3754): Helvetica (the default), Times or Courier. @@ -297,6 +299,10 @@ pub fn expand(template: &str, page_number: u32, count: usize, bates: u64, cx: &C "d/m/yy" => format!("{d}/{m}/{:02}", y.rem_euclid(100)), "d/m/yyyy" => format!("{d}/{m}/{y}"), "dd/mm/yyyy" => format!("{d:02}/{m:02}/{y}"), + "d.m.yy" => format!("{d}.{m}.{:02}", y.rem_euclid(100)), + "d.m.yyyy" => format!("{d}.{m}.{y}"), + "dd.mm.yy" => format!("{d:02}.{m:02}.{:02}", y.rem_euclid(100)), + "dd.mm.yyyy" => format!("{d:02}.{m:02}.{y}"), "yyyy-mm-dd" => format!("{y}-{m:02}-{d:02}"), "yyyy/mm/dd" => format!("{y}/{m:02}/{d:02}"), "yyyy/m/d" => format!("{y}/{m}/{d}"), diff --git a/crates/edit/src/tests.rs b/crates/edit/src/tests.rs index 3ad46e864..3d8752d5a 100644 --- a/crates/edit/src/tests.rs +++ b/crates/edit/src/tests.rs @@ -82,6 +82,7 @@ fn tokens_expand() { assert_eq!(expand("<<1 of n>> · <> · <<1/n>>", 2, 5, 0, &c), "2 of 5 · Page 2 · 2/5"); assert_eq!(expand("<> <> <>", 1, 1, 0, &c), "10/1/2026 2026-10-01 October 1, 2026"); assert_eq!(expand("<> <>", 1, 1, 0, &c), "2026/10/01 2026/10/1"); + assert_eq!(expand("<> <> <> <>", 1, 1, 0, &c), "01.10.2026 1.10.2026 01.10.26 1.10.26"); assert_eq!(expand("<>", 1, 1, 104, &c), "ABC000104-X"); assert_eq!(expand("keep <> and <> and <>"), Some(100)); diff --git a/crates/ui-egui/src/marks_ui.rs b/crates/ui-egui/src/marks_ui.rs index fbca7bb08..5340cef39 100644 --- a/crates/ui-egui/src/marks_ui.rs +++ b/crates/ui-egui/src/marks_ui.rs @@ -117,8 +117,19 @@ impl Default for MarksDraft { const PAGE_FORMATS: [&str; 5] = ["<<1>>", "<<1 of n>>", "<<1/n>>", "<>", "<>"]; // New formats go last: `date_format` is an index into this list. -const DATE_FORMATS: [&str; 8] = - ["<>", "<>", "<>", "<>", "<>", "<>", "<>", "<>"]; +const DATE_FORMATS: [&str; 11] = [ + "<>", + "<>", + "<>", + "<>", + "<>", + "<>", + "<>", + "<>", + "<>", + "<>", + "<>", +]; const BOX_NAMES: [&str; 6] = ["Left Header Text", "Center Header Text", "Right Header Text", "Left Footer Text", "Center Footer Text", "Right Footer Text"]; diff --git a/parity/acrobat-features.toml b/parity/acrobat-features.toml index 69c98d076..1f978a221 100644 --- a/parity/acrobat-features.toml +++ b/parity/acrobat-features.toml @@ -2448,7 +2448,7 @@ status = "shipped" commands = ["edit.header_footer"] tools = ["doc_header_footer"] evidence = ["crates/edit/src/tests.rs::tokens_expand", "crates/engine/src/tests.rs::headers_footers_watermarks_and_backgrounds_show_update_and_remove"] -notes = "<<1>>, <>, <<1 of n>>, <>, dates, Bates" +notes = "<<1>>, <>, <<1 of n>>, <>, dates (US, ISO, day-first with slashes and the dotted <>, <>, <>, <>), Bates. Month names are English only" [[feature]] id = "edit.header-footer-ranges"