ns-suitescript-mocks
Version:
Collection of mocks that can be used to improve unit-tests for SuiteScript 2.0.
23 lines (20 loc) • 527 B
JavaScript
/**
* Return a Netsuite Format Module
*
* @classDescription Format object
* @constructor
* @returns {N/Module}
*/
const moment = require('moment');
module.exports = {
format: options => moment(options.value).format(options.format || 'D.M.YYYY H:m'),
parse: options => moment(options.value, options.format || 'D.M.YYYY H:m').toDate(),
Type: {
DATETIME: 'DATETIME',
DATETIMEZ: 'DATETIMEZ',
},
Timezone: {
EUROPE_AMSTERDAM: 'EUROPE_AMSTERDAM',
AMERICA_LOS_ANGELES: 'AMERICA_LOS_ANGELES',
},
};