Issue
Hi I am developing web application in Angularjs/JavaScript. I have one calender picker and I am capturing dates from the front end. When saving selected date in database I want to save in Hijri format. I followed Converting Gregorian date to Hijri date, it works fine when I pass 1 in the writeIslamicDate. For example:
var today=new Date();
writeIslamicDate(today);
If I pass today date then it gives me undefined, NaN undefined NaN AH
so may I know do I need to convert to any format before passing input to writeIslamicDate? Can someone help me in this? Any help would be appreciated. Thank you.
Solution
you can use moment-hijri.js it a robust library to convert date
moment('2014-11-28 16:40:00', 'YYYY-M-D HH:mm:ss').endOf('iMonth').format('iYYYY/iM/iD HH:mm:ss'); // 1436/2/30 23:59:59
Answered By - hame-dhib
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.