Skip to content

Commit

Permalink
Merge pull request #8 from AlexisOlson/Date
Browse files Browse the repository at this point in the history
Add Date.Today again
  • Loading branch information
OscarValerock authored Apr 18, 2024
2 parents 6b87e25 + 0655e27 commit 33dad72
Show file tree
Hide file tree
Showing 3 changed files with 24 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.pq
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ let
Date.ToText = Date.ToText,
Date.Type = Date.Type,
Date.Year = Date.Year,
DateTime.FixedLocalNow = DateTime.FixedLocalNow,
DateTime.LocalNow = DateTime.LocalNow,
DateTime.Type = DateTime.Type,
DateTimeZone.Type = DateTimeZone.Type,
Expand Down
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 33dad72

Please sign in to comment.