commit 0993e1b2dee5862d802339116542f9ca0815e23f
parent daa45c22af0e94d6caf1197dc6745e527f386394
Author: St John Karp <stjohn@mulligrubs.me>
Date: Thu, 27 Aug 2020 08:34:20 -0500
GNU-Prolog: run today's date through the formatter
Make sure that today's date gets formatted properly.
Because GNU-Prolog doesn't have built-in predicates for this,
I've just directed it to use the format_date predicate which
uses the shell's date command.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dialects/gnu-prolog.pl b/dialects/gnu-prolog.pl
@@ -24,11 +24,12 @@ markdown_to_html(MarkdownEntryCodes, HTMLEntryCodes):-
% GNU-Prolog-specific handling of dates.
-today(DateCodes):-
+today(FormattedDateCodes):-
gnu_prolog,
date_time(dt(Year, Month, Day, Hour, Minute, Second)),
join([Year, '-', Month, '-', Day, ' ', Hour, ':', Minute, ':', Second], '', DateAtom),
- atom_codes(DateAtom, DateCodes).
+ atom_codes(DateAtom, DateCodes),
+ format_date(FormattedDateCodes, DateCodes).
% Format a date as RFC 822 (with a four-digit year).
format_date(FormattedDateCodes, DateCodes):-