Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lastDayofMonth #539

Open
averlon opened this issue Oct 13, 2023 · 2 comments
Open

lastDayofMonth #539

averlon opened this issue Oct 13, 2023 · 2 comments

Comments

@averlon
Copy link

averlon commented Oct 13, 2023

I would like to have some help how to configure the $getLastDayOfMonth(param1,[param2], [param3]) helper with the current year and the current month.

Naturally not with fixed values.

Since I am not that familiar with JSONATA Functions, I would appreciate some help!

Thanks

@averlon
Copy link
Author

averlon commented Oct 18, 2023

any idea?

@averlon
Copy link
Author

averlon commented Oct 20, 2023

I have tried this:

[
    {
        "id": "707224b2daa2c32b",
        "type": "debug",
        "z": "33667947.7eff86",
        "name": "debug 16",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1020,
        "y": 1100,
        "wires": []
    },
    {
        "id": "fd6d5145b176d824",
        "type": "time-inject",
        "z": "33667947.7eff86",
        "name": "",
        "nameInt": "jsonata Ausdr.",
        "positionConfig": "a4ed43d2.4f5588",
        "props": [
            {
                "p": "",
                "pt": "msgPayload",
                "v": "$getLastDayOfMonth(2023, 10, 1)",
                "vt": "jsonata",
                "o": "",
                "oT": "none",
                "oM": "60000",
                "f": 0,
                "fS": 0,
                "fT": "Millisekunden UNIX-Zeit",
                "fI": "0",
                "next": true,
                "days": "",
                "months": "",
                "onlyOddDays": false,
                "onlyEvenDays": false
            },
            {
                "p": "",
                "pt": "msgTopic",
                "v": "",
                "vt": "str",
                "o": "",
                "oT": "none",
                "oM": "60000",
                "f": 0,
                "fS": 0,
                "fT": "Millisekunden UNIX-Zeit",
                "fI": "0",
                "next": false,
                "days": "",
                "months": "",
                "onlyOddDays": false,
                "onlyEvenDays": false
            }
        ],
        "injectTypeSelect": "none",
        "intervalCount": 1,
        "intervalCountType": "num",
        "intervalCountMultiplier": 60000,
        "time": "",
        "timeType": "entered",
        "offset": 0,
        "offsetType": "none",
        "offsetMultiplier": 60000,
        "timeEnd": "",
        "timeEndType": "entered",
        "timeEndOffset": 0,
        "timeEndOffsetType": "none",
        "timeEndOffsetMultiplier": 60000,
        "timeDays": "*",
        "timeOnlyOddDays": false,
        "timeOnlyEvenDays": false,
        "timeMonths": "*",
        "timedatestart": "",
        "timedateend": "",
        "property": "",
        "propertyType": "none",
        "propertyCompare": "true",
        "propertyThreshold": "",
        "propertyThresholdType": "num",
        "timeAlt": "",
        "timeAltType": "entered",
        "timeAltDays": "*",
        "timeAltOnlyOddDays": false,
        "timeAltOnlyEvenDays": false,
        "timeAltMonths": "*",
        "timeAltOffset": 0,
        "timeAltOffsetType": "none",
        "timeAltOffsetMultiplier": 60000,
        "once": false,
        "onceDelay": 0.1,
        "recalcTime": 2,
        "x": 730,
        "y": 1140,
        "wires": [
            [
                "707224b2daa2c32b"
            ]
        ]
    },
    {
        "id": "a4ed43d2.4f5588",
        "type": "position-config",
        "name": "Home",
        "isValide": "true",
        "longitude": "0",
        "latitude": "0",
        "angleType": "deg",
        "timeZoneOffset": 99,
        "timeZoneDST": 0,
        "stateTimeFormat": "3",
        "stateDateFormat": "12"
    }
]

The debug view shows this:

"Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. This will not be optional in Node-RED 4.0. Please identify the node from the following stack and check for an update on npm. If none is available, please notify the node author."

and

Error
    at Object.evaluateJSONataExpression (/usr/local/addons/redmatic/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:775:18)
    at positionConfigurationNode.getPropValue (/usr/local/addons/redmatic/var/node_modules/node-red-contrib-sun-position/nodes/position-config.js:1258:39)
    at positionConfigurationNode.getOutDataProp (/usr/local/addons/redmatic/var/node_modules/node-red-contrib-sun-position/nodes/position-config.js:845:25)
    at timeInjectNode.node.prepOutMsg (/usr/local/addons/redmatic/var/node_modules/node-red-contrib-sun-position/nodes/time-inject.js:603:49)
    at timeInjectNode._inputCallback (/usr/local/addons/redmatic/var/node_modules/node-red-contrib-sun-position/nodes/time-inject.js:880:27)
    at /usr/local/addons/redmatic/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
    at Object.trigger (/usr/local/addons/redmatic/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at timeInject...

and the debug-node shows im msg.payload:

Mon Nov 27 2023 00:00:00 GMT+0100 (GMT+01:00)

Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant