Need help figuring out why moment is returning incorrect value. This is the problem i am facing. At anytime i can get either a french or english value. For example if cMon = "août 2022" when this code runs cNMon returns 2 instead of 8
i tried passing locale but the issue is it needs to be able to accept either french or english and display the correct value.
Line of typescript code
import moment from 'moment';
private static async getCurrent(actor: Actor): Promise<{ Mon: string, Year: number, MonStr: string, NMon: number}> {
let cMon = await actor.requestTo(GetElementText.for(cmon));
let Year = Number(currMonthText.split(" ")[1]);
let MonStr = currMonthText.split(" ")[0];
let cNMon: number = Number(moment().month(currMonthStr.trim()).format("M"));
return { cMon, Year, MonStr, NMon }
}