Monday, 4 January 2021

momentJs in NodeJs (Date change)

const moment = require('moment'); var sDate = moment(); var eDate = ""; // 1">Day if (durationType == "1") { eDate = moment(sDate, "DD-MM-YYYY").add('days', duration); } // 2">Week else if (durationType == "2") { eDate = moment(sDate, "DD-MM-YYYY").add('week', duration); } // 3">Month else if (durationType == "3") { eDate = moment(sDate, "DD-MM-YYYY").add('month', duration); } // 4">Year else if (durationType == "4") { eDate = moment(sDate, "DD-MM-YYYY").add('year', duration); }

No comments:

Post a Comment

IIS deployment support details

  Node JS - IIS deployment support details node: http://go.microsoft.com/?linkid=9784334 IISNode: https://github.com/azure/iisnode/releases/...