After recently updating my local J-Query library from 1.9.1 to 3.6.0 I have noticed some strange issues. I did not see anything online for this, and most of these functions are standard JavaScript functions I believe, and not J-Query. I am seeing that Date() objects are undefined. Also the following errors with Date and Array objects are happening. If I revert the code to 1.9.1 there is no issue. *Also this is a Node.js project, I dont know if that matters.
TypeError: Date.today is not a function at Object. (main.js:8:126614)
Cannot read properties of undefined (reading 'includes')
TypeError: i.add is not a function
Sample Code
var today = Date.today();
UPDATE: It looks like the code that is not working is coming from this node.js package.
https://github.com/datejs/Datejs
When I change the code to
var today = new Date();
var numberOfDays = today.add(5).days();
Then there is a problem with the add method, see the error listed above.
// Type definitions for DateJS
// Project: http://www.datejs.com/
// Definitions by: David Khristepher Santos <https://github.com/rupertavery>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment