From cd0d50aac135d74aac6ee5e2297da258b71ebbae Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 10 Sep 2021 12:21:46 -0700 Subject: [PATCH] Deprecate date options with a time of day setting. Removing the only use, an example in hello-world.scm. GnuCash doesn't use this value in any of its own report options and the feature will be removed in GnuCash 5. Related to bug 798297 Pref "Use 24-hour clock" obsolete?. --- gnucash/report/reports/example/hello-world.scm | 17 ----------------- libgnucash/app-utils/options.scm | 8 ++++++-- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/gnucash/report/reports/example/hello-world.scm b/gnucash/report/reports/example/hello-world.scm index 77f8d55525..2313fbb637 100644 --- a/gnucash/report/reports/example/hello-world.scm +++ b/gnucash/report/reports/example/hello-world.scm @@ -94,15 +94,6 @@ (lambda () (cons 'absolute (current-time))) #f 'absolute #f )) - ;; This is another date option, but the user can also select - ;; the time. - (add-option - (gnc:make-date-option - (N_ "Hello, World!") (N_ "Time and Date Option") - "e" (N_ "This is a date option with time.") - (lambda () (cons 'absolute (current-time))) - #t 'absolute #f )) - (add-option (gnc:make-date-option (N_ "Hello, World!") (N_ "Combo Date Option") @@ -234,8 +225,6 @@ option like this.") (string-val (op-value "Hello, World!" "String Option")) (date-val (gnc:date-option-absolute-time (op-value "Hello, World!" "Just a Date Option"))) - (date2-val (gnc:date-option-absolute-time - (op-value "Hello, World!" "Time and Date Option"))) (rel-date-val (gnc:date-option-absolute-time (op-value "Hello, World!" "Relative Date Option"))) (combo-date-val (gnc:date-option-absolute-time @@ -258,7 +247,6 @@ option like this.") ;; qof-print-date (let ((time-string (gnc-print-time64 (current-time) "%X")) (date-string (gnc-print-time64 date-val "%x")) - (date-string2 (gnc-print-time64 date2-val "%x %X")) (rel-date-string (gnc-print-time64 rel-date-val "%x")) (combo-date-string (gnc-print-time64 combo-date-val "%x"))) @@ -369,11 +357,6 @@ new, totally cool report, consult the mailing list ~a.") (G_ "The date option is ~a.") (gnc:html-markup-b date-string))) - (gnc:html-markup-p - (gnc:html-markup/format - (G_ "The date and time option is ~a.") - (gnc:html-markup-b date-string2))) - (gnc:html-markup-p (gnc:html-markup/format (G_ "The relative date option is ~a.") diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm index 5befd47437..8481572cbb 100644 --- a/libgnucash/app-utils/options.scm +++ b/libgnucash/app-utils/options.scm @@ -719,10 +719,14 @@ the option '~a'.")) (begin (rpterror-earlier "date" item (car full-list)) 0))) - (let* ((value (default-getter)) + (if show-time + (issue-deprecation-warning + (format #f "Date options with time of day values are deprecated and will be removed in GnuCash 5."))) + + (let* ((value (default-getter)) (value->string (lambda () (string-append "'" (gnc:value->string value))))) - (gnc:make-option + (gnc:make-option section name sort-tag 'date documentation-string (lambda () value) (lambda (date)