Does angular Schedule support Moment.js.

Does angular Schedule support Moment.js as date time input. If no then whats are all format it supports

3 Replies

VM Vengatesh Maniraj Syncfusion Team March 13, 2020 04:48 AM UTC

Hi tabinda, 

Greetings from Syncfusion Support. 

Angular scheduler supports the Moment.js for date time inputs. Please check the below sample for more reference. 


Regards, 
Vengatesh 



TM Tabinda Muslim March 17, 2020 03:27 AM UTC

The Sample which you shared, is just a demo of changing timezone, and not anything related with Moment.js


VM Vengatesh Maniraj Syncfusion Team March 18, 2020 05:47 AM UTC

Hi Tabinda, 

Thanks for the update. 

In our shared sample, we have used the Moment.js to get the timezone related inputs. Kindly refer the below code snippet. 
declare var moment: any; 

  constructor() { 
        // Here remove the local offset from events 
        let timezone: Timezone = new Timezone(); 
        for (let fifaEvent of this.fifaEvents) { 
            let event: { [key: string]: Object } = fifaEvent as { [key: string]: Object }; 
            event.StartTime = timezone.removeLocalOffset(<Date>event.StartTime); 
            event.EndTime = timezone.removeLocalOffset(<Date>event.EndTime); 
        } 
        if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { 
            Timezone.prototype.offset = (date: Date, timezone: string): number => { 
                return moment.tz.zone(timezone).utcOffset(date.getTime()); 
            }; 
        } 
        this.eventSettings = { dataSource: this.fifaEvents }; 
    } 

And also we have already discussed for date time input in the below forum. 

Kindly refer all the above and still, you are not clear with how to use moment.js, kindly share us more details to serve you better. 

Regards, 
Vengatesh 


Loader.
Up arrow icon