Skip to content

Commit

Permalink
Merge pull request #4 from AlexisOlson/main
Browse files Browse the repository at this point in the history
Add Date.Today function
  • Loading branch information
OscarValerock authored Apr 14, 2024
2 parents 84fa420 + 435ebfc commit 8ccd513
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Functions/Date/Date.Today.pq
Original file line number Diff line number Diff line change
@@ -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.
"
<p>Returns the current date value on the system.</p>
<p>This function is a shortcut for Date.From(DateTime.FixedLocalNow())</p>
",
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)
1 change: 1 addition & 0 deletions M_Creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'bibb.pro',
'community.powerbi',
'community.fabric',
'Date.Today',
'Documentation.Author',
'Documentation.Examples',
'Documentation.FieldCaption',
Expand Down

0 comments on commit 8ccd513

Please sign in to comment.