tlc-core-automation-framework-v3-wdio-v9
Version:
Background: - We are following multi-layer automation framework architecture using webdriver.io + cucumber + typescript This core framework has been implemented with generic utility functions and cucumber steps, which can be easily consumed by another fra
25 lines (19 loc) • 662 B
text/typescript
import moment from "moment-timezone";
export class MomentHelper {
public static convertBneToLocal(date: string) {
const incomingDateFmt: string = 'h:mma MMM D, YYYY';
return moment.tz(date, incomingDateFmt, "Australia/Brisbane").local().format(incomingDateFmt);
}
public static getCurrentMonthAndYear() {
return moment().format("MMMM YYYY");
}
public static getCurrentYear() {
return moment().format("YYYY");
}
public static getCurrentMonth() {
return moment().format("MMMM");
}
public static formatMonth(month: string) {
return moment(month, 'MM').format('MMMM');
}
}