I have a date module that returns current date that is set in system:
function getDateFormatAndISODate() {
const dates = require('./resources/getSystemDate').getSystemDate();
return dates;
}
module.exports.getDateFormatAndISODate = getDateFormatAndISODate;
I am requiring it in another file:
import * as isoDateModule from './datastream-get-iso-module';
The issue is the method call is not returning new date values when user changes the date manually from system and call this method again:
isoDateModule.getDateFormatAndISODate(dateVal);
I am using c
node addon in my project and I am requiring it like this:
function requireUncached(module) {
delete require.cache[require.resolve(module)];
return require(module);
}
const dates = requireUncached('./resources/getSystemDate').getSystemDate();
But still I get the old date values. Not sure whats missing