From 435ebfc7435a373cdcbdc5737c16b7d4e34aaf55 Mon Sep 17 00:00:00 2001 From: Alexis Olson Date: Sat, 13 Apr 2024 18:34:03 -0500 Subject: [PATCH] Add Date.Today function --- Functions/Date/Date.Today.pq | 22 ++++++++++++++++++++++ M_Creator.py | 1 + 2 files changed, 23 insertions(+) create mode 100644 Functions/Date/Date.Today.pq diff --git a/Functions/Date/Date.Today.pq b/Functions/Date/Date.Today.pq new file mode 100644 index 0000000..c73bba5 --- /dev/null +++ b/Functions/Date/Date.Today.pq @@ -0,0 +1,22 @@ +let + // Define metadata for the function, describing its purpose and usage. + metaDocumentation = type function ( ) as date meta [ + Documentation.Name = "Date.Today", + Documentation.LongDescription = + //This is the description of the documentation, it only accepts a handful of HTML tags for formatting. + " +

Returns the current date value on the system.

+

This function is a shortcut for Date.From(DateTime.FixedLocalNow())

+ ", + Documentation.Examples = { + [ + Description = " ", + Code = "Date.Today()", + Result = Text.From(Date.From(DateTime.FixedLocalNow())) + ] + }], + // Define the main function + myFunction = () as date => Date.From(DateTime.FixedLocalNow()) +in + // Apply the function metadata to myFunction. + Value.ReplaceType(myFunction, metaDocumentation) \ No newline at end of file diff --git a/M_Creator.py b/M_Creator.py index de8a1fc..fd7f4c5 100644 --- a/M_Creator.py +++ b/M_Creator.py @@ -10,6 +10,7 @@ 'bibb.pro', 'community.powerbi', 'community.fabric', + 'Date.Today', 'Documentation.Author', 'Documentation.Examples', 'Documentation.FieldCaption',