I have a series of Javascript classes that extend the Date object to cover different calendars. The idea is that, regardless of calendar, the Unix timestamp stored by a Date object is universal.
So, I can have const julianChristmas = new JulianDate(2023, 11, 25) which encodes Christmas Day in the Julian calendar. I've set the various string methods to return nice representations of the date, but if I do console.log(julianChristmas), I still get a string with the equivalent Gregorian date for 7 Jan 2024.
Is there anyway to overwrite the default behaviour of Date in JulianDate (and the other classes) so that it won't display Gregorian date representations?
I've rewritten all of the documented string methods of Date in the class, but none of them overwrites the default representation.