# HG changeset patch # User Markus Mützel # Date 1642181226 -3600 # Node ID e9bfb92dab01b1cd5c86860bf58b5a3f07679e90 # Parent 7677d53497c9b2d5e21750829f95428d9e2d0290 datevec.m: Emit warning if format specifiers are used with opposite case (bug #47627). * scripts/time/datevec.m (__date_vfmt2sfmt__): Emit warning if date or time format specifiers are used with opposite case. diff -r 7677d53497c9 -r e9bfb92dab01 scripts/time/datevec.m --- a/scripts/time/datevec.m Fri Jan 14 17:55:53 2022 +0100 +++ b/scripts/time/datevec.m Fri Jan 14 18:27:06 2022 +0100 @@ -208,6 +208,13 @@ original_f = f; # Store for error messages. + if (any (ismember (f, "hsfYD"))) + warning ("Octave:date-format-spec:wrong-case", ... + ["datevec: Format specifiers for dates should be lower case,", ... + " format specifiers for time should be upper case. ", ... + " Possible issue with 'm' (month) and 'M' (minutes)?"]); + endif + ## Play safe with percent signs. f = strrep (f, "%", "%%");