0

Below ill share, my code for reference

 getTimeZoneTime(val: string) {
    const userTimeZoneTime = moment
      .utc(val)
      .utcOffset(this.currentTimeZone)
      .local()
      .format('YYYY-MM-DD HH:mm:ss A');
    return userTimeZoneTime;
  }

I have set the time zone using moment and UTC and I have returned the time zone at the end in this I have set the type to the current time zone as string currentTimeZone: string here I have created a form in that time zone will be displayed, I'm new to unit testing how can I write a spec for this function

0 Answers0