Intial Commit

This commit is contained in:
valki
2020-10-17 18:42:50 +02:00
commit 664c6d8ca3
5892 changed files with 759183 additions and 0 deletions

View File

@@ -0,0 +1,161 @@
[
{
"id": "320464b5.d0134c",
"type": "moment",
"z": "533475c4.a28eac",
"name": "input: msg.payload",
"topic": "",
"input": "",
"inputType": "msg",
"inTz": "America/New_York",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "YYYY-MM-DD HH:mm",
"locale": "en_US",
"output": "now",
"outputType": "msg",
"outTz": "America/New_York",
"x": 470,
"y": 400,
"wires": [
[
"72ed58b3.7f9178"
]
]
},
{
"id": "aceef80.40a4908",
"type": "inject",
"z": "533475c4.a28eac",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 240,
"y": 340,
"wires": [
[
"320464b5.d0134c"
]
]
},
{
"id": "72ed58b3.7f9178",
"type": "debug",
"z": "533475c4.a28eac",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 650,
"y": 400,
"wires": []
},
{
"id": "bbe21120.87815",
"type": "inject",
"z": "533475c4.a28eac",
"name": "blank string",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 230,
"y": 380,
"wires": [
[
"320464b5.d0134c"
]
]
},
{
"id": "e49c12a.d2215f",
"type": "inject",
"z": "533475c4.a28eac",
"name": "'test'",
"topic": "",
"payload": "test",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 250,
"y": 420,
"wires": [
[
"320464b5.d0134c"
]
]
},
{
"id": "58881f8c.6cc45",
"type": "inject",
"z": "533475c4.a28eac",
"name": "null",
"topic": "",
"payload": "null",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 250,
"y": 460,
"wires": [
[
"320464b5.d0134c"
]
]
},
{
"id": "43a381eb.dae01",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Pass different data types to a valid input property",
"info": "",
"x": 560,
"y": 360,
"wires": []
},
{
"id": "e2fe39e8.d9aba8",
"type": "inject",
"z": "533475c4.a28eac",
"name": "Invalid Date String",
"topic": "Invalid Date String",
"payload": "36th September 3046",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 210,
"y": 500,
"wires": [
[
"320464b5.d0134c"
]
]
},
{
"id": "4b9bf042.f40d3",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Expected Results",
"info": "Requests input from `msg.payload` but puts\noutput to `msg.now`.\n\n\n## Timestamp input\n\n```\n{\n \"_msgid\":\"2792614c.a404ee\",\"topic\":\"\",\n \"payload\":1537718900126,\n \"now\":\"2018-09-23 12:08\"\n}\n```\n\n## All other inputs\n\n1. An output warning message\n `The input property was NOT a recognisable date. Output will be a blank string`\n\n2. `msg.payload` set to input msg.payload\n3. `msg.now` set to empty string.\n",
"x": 460,
"y": 460,
"wires": []
}
]

View File

@@ -0,0 +1,141 @@
[
{
"id": "6e87ca1f.077804",
"type": "moment",
"z": "533475c4.a28eac",
"name": "input: msg.foo",
"topic": "",
"input": "foo",
"inputType": "msg",
"inTz": "America/New_York",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "YYYY-MM-DD HH:mm",
"locale": "en_US",
"output": "now",
"outputType": "msg",
"outTz": "America/New_York",
"x": 460,
"y": 660,
"wires": [
[
"61f6f582.f8708c"
]
]
},
{
"id": "12d13caf.fd1683",
"type": "inject",
"z": "533475c4.a28eac",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 240,
"y": 600,
"wires": [
[
"6e87ca1f.077804"
]
]
},
{
"id": "61f6f582.f8708c",
"type": "debug",
"z": "533475c4.a28eac",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 650,
"y": 660,
"wires": []
},
{
"id": "63c7416c.aa3ce",
"type": "inject",
"z": "533475c4.a28eac",
"name": "blank string",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 230,
"y": 640,
"wires": [
[
"6e87ca1f.077804"
]
]
},
{
"id": "c371a083.37e4f",
"type": "inject",
"z": "533475c4.a28eac",
"name": "'test'",
"topic": "",
"payload": "test",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 250,
"y": 680,
"wires": [
[
"6e87ca1f.077804"
]
]
},
{
"id": "c0c9733a.5abb3",
"type": "inject",
"z": "533475c4.a28eac",
"name": "null",
"topic": "",
"payload": "null",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 250,
"y": 720,
"wires": [
[
"6e87ca1f.077804"
]
]
},
{
"id": "bed64b79.64ac88",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Reference a non-existent input property",
"info": "",
"x": 530,
"y": 620,
"wires": []
},
{
"id": "805b442c.c26d48",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Expected Results",
"info": "As the input msg property does not exist,\n**all** outputs will be the same:\n\n```\n{\n \"_msgid\":\"fbb0e16f.af613\",\"topic\":\"\",\n \"payload\":1537719147115,\n \"now\":\"2018-09-23 12:12\"\n}\n```\n\n1. `msg.payload` set to input msg.payload\n3. `msg.now` set to current date/time string.\n",
"x": 460,
"y": 720,
"wires": []
}
]

View File

@@ -0,0 +1,91 @@
[
{
"id": "df76bbb4.8529e8",
"type": "inject",
"z": "533475c4.a28eac",
"name": "UNIX timestamp",
"topic": "UNIX timestamp",
"payload": "1512545487",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 180,
"y": 380,
"wires": [
[
"c5a8c.dddf4574"
]
]
},
{
"id": "c5a8c.dddf4574",
"type": "moment",
"z": "533475c4.a28eac",
"name": "",
"topic": "",
"input": "",
"inputType": "msg",
"inTz": "",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "",
"locale": "",
"output": "",
"outputType": "msg",
"outTz": "",
"x": 420,
"y": 380,
"wires": [
[
"e5a3e641.545528"
]
]
},
{
"id": "e5a3e641.545528",
"type": "debug",
"z": "533475c4.a28eac",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 610,
"y": 380,
"wires": []
},
{
"id": "48c26998.0d90a8",
"type": "inject",
"z": "533475c4.a28eac",
"name": "JS Timestamp",
"topic": "JS Timestamp",
"payload": "1512545487000",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 170,
"y": 420,
"wires": [
[
"c5a8c.dddf4574"
]
]
},
{
"id": "d12e7985.07ef88",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Expected Output",
"info": "UNIX Timestamps are the number of **SECONDS** \nsince 1970-01-01 00:00:00.\n\nJavaScript Timestamps are the number of **MILLIseconds**\nsince 1970-01-01 00:00:00.\n\nMoment.JS only recognises JavaScript timestamps\nso if you want to process a UNIX timestamp, \nplease multiply by 1000 as in the second\ninput.",
"x": 400,
"y": 420,
"wires": []
}
]

View File

@@ -0,0 +1,218 @@
[
{
"id": "e75759f3.14aed8",
"type": "moment",
"z": "533475c4.a28eac",
"name": "",
"topic": "OBJECT OUTPUT",
"input": "",
"inputType": "msg",
"inTz": "Europe/London",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "object",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "Europe/London",
"x": 470,
"y": 360,
"wires": [
[
"3514268f.2b575a"
]
]
},
{
"id": "749a67b1.8511e8",
"type": "inject",
"z": "533475c4.a28eac",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 120,
"y": 360,
"wires": [
[
"e75759f3.14aed8",
"d057c5dc.43ec08",
"6a30d321.63b5ec",
"3562ef2d.e961c",
"2046d084.fb1e4"
]
]
},
{
"id": "3514268f.2b575a",
"type": "debug",
"z": "533475c4.a28eac",
"name": "",
"active": true,
"console": "false",
"complete": "payload",
"x": 870,
"y": 440,
"wires": []
},
{
"id": "d057c5dc.43ec08",
"type": "moment",
"z": "533475c4.a28eac",
"name": "",
"topic": "JSDATE (date) OUTPUT",
"input": "",
"inputType": "msg",
"inTz": "Europe/London",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "jsdate",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "Europe/London",
"x": 490,
"y": 400,
"wires": [
[
"3514268f.2b575a"
]
]
},
{
"id": "6a30d321.63b5ec",
"type": "moment",
"z": "533475c4.a28eac",
"name": "",
"topic": "CALENDAR (AROUNDNOW) OUTPUT",
"input": "",
"inputType": "msg",
"inTz": "Europe/London",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "calendar",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "Europe/London",
"x": 540,
"y": 440,
"wires": [
[
"3514268f.2b575a"
]
]
},
{
"id": "3562ef2d.e961c",
"type": "moment",
"z": "533475c4.a28eac",
"name": "",
"topic": "FROMNOW (TIMEAGO) OUTPUT",
"input": "",
"inputType": "msg",
"inTz": "Europe/London",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "fromnow",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "Europe/London",
"x": 520,
"y": 480,
"wires": [
[
"3514268f.2b575a"
]
]
},
{
"id": "2046d084.fb1e4",
"type": "moment",
"z": "533475c4.a28eac",
"name": "",
"topic": "ISO8601 (ISO) OUTPUT",
"input": "",
"inputType": "msg",
"inTz": "Europe/London",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "iso8601",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "Europe/London",
"x": 490,
"y": 520,
"wires": [
[
"3514268f.2b575a"
]
]
},
{
"id": "487012c7.d8d1bc",
"type": "inject",
"z": "533475c4.a28eac",
"name": "string yr 1st",
"topic": "",
"payload": "2017/6/14 20:10:10.276",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 130,
"y": 400,
"wires": [
[
"e75759f3.14aed8",
"d057c5dc.43ec08",
"6a30d321.63b5ec",
"3562ef2d.e961c",
"2046d084.fb1e4"
]
]
},
{
"id": "366462c6.c51dbe",
"type": "inject",
"z": "533475c4.a28eac",
"name": "string complex",
"topic": "",
"payload": "Thu Jun 15 2017 18:02:13 GMT+0100 (GMT Summer Time)",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 140,
"y": 440,
"wires": [
[
"e75759f3.14aed8",
"d057c5dc.43ec08",
"6a30d321.63b5ec",
"3562ef2d.e961c",
"2046d084.fb1e4"
]
]
},
{
"id": "d384ff51.8b4d",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Expected Output",
"info": "| Input | Moment | Output |\n|------------------|-----------------------------|---------------------------------------------------------------------------------------------|\n| timestamp | OBJECT OUTPUT | {\"years\":2018,\"months\":8,\"date\":23,\"hours\":17,\"minutes\":0,\"seconds\":54,\"milliseconds\":298} |\n| | JSDATE (date) OUTPUT | Sun Sep 23 2018 17:00:54 GMT+0100 (GMT Summer Time) |\n| | CALENDAR (AROUNDNOW) OUTPUT | Today at 17:00 |\n| | FROMNOW (TIMEAGO) OUTPUT | a few seconds ago |\n| | ISO8601 (ISO) OUTPUT | 2018-09-23T16:00:54.298Z |\n| String Yr 1st | OBJECT OUTPUT | {\"years\":2017,\"months\":5,\"date\":14,\"hours\":20,\"minutes\":10,\"seconds\":10,\"milliseconds\":276} |\n| | JSDATE (date) OUTPUT | Wed Jun 14 2017 20:10:10 GMT+0100 (GMT Summer Time) |\n| | CALENDAR (AROUNDNOW) OUTPUT | 2017-06-14 |\n| | FROMNOW (TIMEAGO) OUTPUT | a year ago |\n| | ISO8601 (ISO) OUTPUT | 2017-06-14T19:10:10.276Z |\n| String (Complex) | OBJECT OUTPUT | {\"years\":2017,\"months\":5,\"date\":15,\"hours\":18,\"minutes\":2,\"seconds\":13,\"milliseconds\":0} |\n| | JSDATE (date) OUTPUT | Thu Jun 15 2017 18:02:13 GMT+0100 (GMT Summer Time) |\n| | CALENDAR (AROUNDNOW) OUTPUT | 2017-06-15 |\n| | FROMNOW (TIMEAGO) OUTPUT | a year ago |\n| | ISO8601 (ISO) OUTPUT | 2017-06-15T17:02:13.000Z |\n\nNeedess to say that your timestamp values will be different.",
"x": 780,
"y": 380,
"wires": []
}
]

View File

@@ -0,0 +1,164 @@
[
{
"id": "9fe47dca.ad366",
"type": "moment",
"z": "533475c4.a28eac",
"name": "UTC-4",
"topic": "UTC-4",
"input": "payload",
"inputType": "msg",
"inTz": "ETC/GMT-4",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "ddd Do MMM YYYY HH:mm",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "ETC/GMT-4",
"x": 450,
"y": 640,
"wires": [
[
"3b9b0dc5.bae662"
]
]
},
{
"id": "3c0267e8.e1c0b8",
"type": "inject",
"z": "533475c4.a28eac",
"name": "2017-05-28T21:00:00-04:00",
"topic": "",
"payload": "2017-05-28T21:00:00-04:00",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 200,
"y": 700,
"wires": [
[
"9fe47dca.ad366",
"71ef9d10.3d4904",
"72638b85.4698d4"
]
]
},
{
"id": "3b9b0dc5.bae662",
"type": "debug",
"z": "533475c4.a28eac",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 890,
"y": 640,
"wires": []
},
{
"id": "71ef9d10.3d4904",
"type": "moment",
"z": "533475c4.a28eac",
"name": "UTC",
"topic": "UTC",
"input": "payload",
"inputType": "msg",
"inTz": "etc/GMT-4",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "ddd Do MMM YYYY HH:mm",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "UTC",
"x": 450,
"y": 680,
"wires": [
[
"3b9b0dc5.bae662"
]
]
},
{
"id": "72638b85.4698d4",
"type": "moment",
"z": "533475c4.a28eac",
"name": "UTC+10",
"topic": "UTC+10",
"input": "payload",
"inputType": "msg",
"inTz": "etc/GMT-4",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "ddd Do MMM YYYY HH:mm",
"locale": "en_GB",
"output": "",
"outputType": "msg",
"outTz": "etc/GMT+10",
"x": 460,
"y": 720,
"wires": [
[
"3b9b0dc5.bae662"
]
]
},
{
"id": "e862abcc.69b328",
"type": "inject",
"z": "533475c4.a28eac",
"name": "2017-05-28T21:00:00",
"topic": "",
"payload": "2017-05-28T21:00:00",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 180,
"y": 760,
"wires": [
[
"72638b85.4698d4",
"71ef9d10.3d4904",
"9fe47dca.ad366"
]
]
},
{
"id": "ace5ef2a.af5c2",
"type": "inject",
"z": "533475c4.a28eac",
"name": "2017-05-28T21:00:00Z",
"topic": "",
"payload": "2017-05-28T21:00:00Z",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 180,
"y": 640,
"wires": [
[
"9fe47dca.ad366",
"71ef9d10.3d4904",
"72638b85.4698d4"
]
]
},
{
"id": "acbc2d1d.86082",
"type": "comment",
"z": "533475c4.a28eac",
"name": "Expected Results",
"info": "| Input | Moment | Output |\n|---------------------------|--------|-------------------------|\n| 2017-05-28T21:00:00Z | UTC-4 | Mon 29th May 2017 01:00 |\n| | UTC | Sun 28th May 2017 21:00 |\n| | UTC+10 | Sun 28th May 2017 11:00 |\n| 2017-05-28T21:00:00-04:00 | UTC-4 | Mon 29th May 2017 05:00 |\n| | UTC | Mon 29th May 2017 01:00 |\n| | UTC+10 | Sun 28th May 2017 15:00 |\n| 2017-05-28T21:00:00 | UTC-4 | Sun 28th May 2017 07:00 |\n| | UTC | Sun 28th May 2017 17:00 |\n| | UTC+10 | Sun 28th May 2017 21:00 |",
"x": 700,
"y": 760,
"wires": []
}
]