Skip to content

Commit

Permalink
Merge pull request #861 from yavisht/feature/add-date-time-tool-for-m…
Browse files Browse the repository at this point in the history
…arketplace

feat: dateTime marketplace tool
  • Loading branch information
HenryHengZJ authored Sep 1, 2023
2 parents 691ad48 + d03108d commit 238db00
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/server/marketplaces/tools/Get Current DateTime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "todays_date_time",
"description": "Useful to get todays day, date and time.",
"color": "linear-gradient(rgb(117,118,129), rgb(230,10,250))",
"iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/javascript.svg",
"schema": "[]",
"func": "const timeZone = 'Australia/Sydney';\nconst options = {\n timeZone: timeZone,\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: true\n};\nconst today = new Date();\nconst formattedDate = today.toLocaleString('en-GB', options);\nconst result = {\n \"formattedDate\": formattedDate,\n \"timezone\": timeZone\n};\nreturn JSON.stringify(result);\n"
}

0 comments on commit 238db00

Please sign in to comment.