I installed the ‘dateformat’ npm module but am unable to import it into my code.
The Github ‘dateformat’ documentation says to import using:
var dateFormat = require('dateformat');
… but Corvid doesn’t seem to support the “require” function.
Both
import dateFormat from 'dateformat'
import dateformat from 'dateformat'
give me the same error:
- Cannot find module ‘dateformat’ in ‘public/pages/dqqdc.js’
I am trying to call a function like this from the node_module dateformat module:
$item("#textCloseTime").text = dateFormat(itemData.bidCloseDateTime,"longTime")
which should work according to the Github documentation.
-
How do I import the module into Wix?
-
How do I call it?
Thanks in advance!