dateObj.getMonth() not working in nativescript -
i trying month date object . getiing error whci displays says "getmonth not function". since saw java script tutorials , getmonth() supported in es6. missing importing anything.
var config = require("../../shared/config"); var fetchmodule = require("fetch"); var observablearray = require("data/observable-array").observablearray; var datepickermodule = require("tns-core-modules/ui/date-picker"); function tasklistviewmodel(items){ var listmodel = new observablearray(items); listmodel.gettasklist = function() { return fetchmodule.fetch(config.tasklisturl,{ method:"get" }) .then(handleerrors) .then(function(response){ return response.json(); }).then(function(data) { data.foreach(function(element) { var dateobj = date.parse(element.followupdate) listmodel.push({ fallowupdatemonth:dateobj.getmonth(), faloowupdateday:dateobj.getdate(), fallowupdateyear:dateobj.getfullyear(), }); }); }); }; return listmodel; } module.exports = tasklistviewmodel;
Comments
Post a Comment