Skip to content

Commit 6818ea4

Browse files
lixingwangFrank Martinez
authored and
Frank Martinez
committed
add example to make it can using in UI as it is
1 parent bac505e commit 6818ea4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

function/datetime/descriptor.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "add",
1010
"description": "Add the given number of years, months and days to the DateTime",
11-
"example": "datetime.format(datetime.add(\"2020-03-19T15:02:03Z\", 1,1, 3), \"RFC3339\") => 2021-04-22T15:02:03Z",
11+
"example": "datetime.addHours(datetime.current(), 3) => 2021-05-30T16:38:55.34586567Z",
1212
"args": [
1313
{
1414
"name": "datetime",
@@ -40,7 +40,7 @@
4040
{
4141
"name": "addHours",
4242
"description": "Add the given number of hours to the DateTime",
43-
"example": "datetime.format(datetime.addHours(\"2020-03-19T15:02:03\", 3), \"RFC3339\") => 2020-03-19T18:02:03Z",
43+
"example": "datetime.addHours(datetime.current(), 3) => 2020-04-27T19:38:55.345832054Z",
4444
"args": [
4545
{
4646
"name": "datetime",
@@ -62,7 +62,7 @@
6262
{
6363
"name": "addMins",
6464
"description": "Add the given number of mins to the DateTime",
65-
"example": "datetime.format(datetime.addMins(\"2020-03-19T15:02:03\", 30), \"RFC3339\") => 2020-03-19T19:32:03Z",
65+
"example": "datetime.addMins(datetime.current(), 30) => 2020-04-27T17:08:55.345841684Z",
6666
"args": [
6767
{
6868
"name": "datetime",
@@ -84,7 +84,7 @@
8484
{
8585
"name": "addSeconds",
8686
"description": "Add the given number of seconds to the DateTime",
87-
"example": "datetime.format(datetime.addSeconds(\"2020-03-19T15:02:03\", 30), \"RFC3339\") => 2020-03-19T18:02:33Z",
87+
"example": "datetime.addSeconds(datetime.current(), 30) => 2020-04-27T16:39:25.345860393Z",
8888
"args": [
8989
{
9090
"name": "datetime",
@@ -106,7 +106,7 @@
106106
{
107107
"name": "create",
108108
"description": "Create date by given year, months, days, hours, mins, seconds, nanoseconds and timezone, the timezone follow the IANA Time Zone",
109-
"example": "datetime.format(datetime.create(2020,1,3,2,22,0, \"America/Los_Angeles\"), \"RFC3339\") => 2020-01-03T02:22:00-08:00",
109+
"example": "datetime.create(2020,1,3,2,22,0,0, \"America/Los_Angeles\") => 2020-01-03T02:22:00-08:00",
110110
"args": [
111111
{
112112
"name": "years",
@@ -192,7 +192,7 @@
192192
{
193193
"name": "diff",
194194
"description": "Return the difference between two given DateTime, the difference controlled by argument type, the type in (days,hours,mins and seconds)",
195-
"example": "datetime.diff(\"2020-03-19T15:02:03\",\"2020-03-18:02:03\", \"hours\") => 3",
195+
"example": "datetime.diff(datetime.current(), datetime.addHours(datetime.current(), 2), \"hours\") => 2",
196196
"args": [
197197
{
198198
"name": "start",
@@ -217,7 +217,7 @@
217217
{
218218
"name": "format",
219219
"description": "Format the date according to the specified format. The format uses MM(month), DD(day), YYYY(year), hh(hour), mm(minute) and ss(second), they are case insensitive except MM. it also can format with predefine layout ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339 and RFC3339Nano",
220-
"example": "datetime.format\"02/08/2017\", \"dd-MM-yyyy\"=> 08-02-2017",
220+
"example": "datetime.format(datetime.current(), \"RFC3339\")=> 2020-04-27T16:38:45Z",
221221
"args": [
222222
{
223223
"name": "datetime",
@@ -298,7 +298,7 @@
298298
{
299299
"name": "parse",
300300
"description": "Parse the given datetime to the DateTime with time zone, default base on UTC and timezone follow the IANA Time Zone ",
301-
"example": "datetime.format(datetime.addSeconds(\"2020-03-19T15:02:03+06:00\", \"America/Los_Angeles\"), \"RFC3339\") => 2020-03-19T02:02:03-07:00",
301+
"example": "datetime.parse(\"2020-03-19T15:02:03+06:00\", \"America/Los_Angeles\") => 2020-03-19T02:02:03-07:00",
302302
"args": [
303303
{
304304
"name": "str",
@@ -320,7 +320,7 @@
320320
{
321321
"name": "sub",
322322
"description": "Subtract the given number of years, months and days from the DateTime",
323-
"example": "datetime.format(datetime.sub(\"2020-03-19T15:02:03\", 1,1,1), \"RFC3339\") => 2019-02-18T15:02:03Z",
323+
"example": "datetime.sub(datetime.current(), 1,1,1) => 2019-03-26T16:38:55.345876511Z",
324324
"args": [
325325
{
326326
"name": "datetime",
@@ -352,7 +352,7 @@
352352
{
353353
"name": "subHours",
354354
"description": "Subtract the given number of hours from the DateTime",
355-
"example": "datetime.format(datetime.subHours(\"2020-03-19T15:02:03\",1), \"RFC3339\") => 2020-03-19T14:02:03Z",
355+
"example": "datetime.subHours(datetime.current(),1) => 2020-04-27T15:38:55.345861378Z",
356356
"args": [
357357
{
358358
"name": "datetime",
@@ -373,7 +373,7 @@
373373
{
374374
"name": "subMins",
375375
"description": "Subtract the given number of minutes from the DateTime",
376-
"example": "datetime.format(datetime.subMins(\"2020-03-19T15:02:03\",10), \"RFC3339\") => 2020-03-19T14:52:03Z",
376+
"example": "datetime.subMins(datetime.current(),10) => 2020-04-27T16:28:55.345864058Z",
377377
"args": [
378378
{
379379
"name": "datetime",
@@ -394,7 +394,7 @@
394394
{
395395
"name": "subSeconds",
396396
"description": "Subtract the given number of seconds from the DateTime",
397-
"example": "datetime.format(datetime.subSeconds(\"2020-03-19T15:02:03\",10), \"RFC3339\") => 2020-03-19T15:01:53Z",
397+
"example": "datetime.subSeconds(datetime.current(),10) => 2020-04-27T16:38:45.346028182Z",
398398
"args": [
399399
{
400400
"name": "datetime",

0 commit comments

Comments
 (0)