I think toJD()
is not what you need:
var d = $.calendars.newDate(1388, 1, 1, 'persian', 'fa');
console.log("Persian date: "+d.toLocaleString()); // Persian date: 1388-01-01
var e = d.toJSDate();
console.log(e); // Sat Mar 21 2009 00:00:00 GMT+0100 (Romance Standard Time)
UPDATE: For your comment I see the issue is not solved with this because it transforms the Persian date to your locale date. As far as I can see in the library's reference, there is no way to tell to that function which locale should be used. So the correct way, as the author's provided demo shows, is creating another target calendar and pass the current one as parameter:
var d = $.calendars.newDate(1388, 1, 1, 'persian', 'fa');
var e = $.calendars.newDate(d, 'gregorian', 'fa');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…