socib / Leaflet.TimeDimension

Add time dimension capabilities on a Leaflet map.
MIT License
435 stars 138 forks source link

Add moment-jalaali to change convert date and time to jalali calendar from #176

Closed rahimramezanian closed 4 years ago

rahimramezanian commented 4 years ago

The date time slider is always in Georgian calendar, Would you please use something like https://github.com/jalaali/moment-jalaali to also support Jalali calendar. Thanks.

bielfrontera commented 4 years ago

Hi @rahimramezanian, you can customize how the date is displayed creating a custom L.Control.TimeDimension and overwritting the method _getDisplayDateFormat.

Example:

L.Control.TimeDimensionCustom = L.Control.TimeDimension.extend({
    _getDisplayDateFormat: function(date){
        return moment(date, 'jYYYY/jM/jD');
    }
});
var timeDimensionControl = new L.Control.TimeDimensionCustom({});
map.addControl(timeDimensionControl);

More information at #145

rahimramezanian commented 4 years ago

Hi @bielfrontera Thanks.