hijriyah year javascript

Solutions on MaxInterview for hijriyah year javascript by the best coders in the world

showing results for - "hijriyah year javascript"
Rafael
03 Jul 2020
1function dynamicHijriyahYear() {
2  let yearHijriyah = 1422;
3  let initializeHijriyah = 1422;
4  let yearsHijriyah = [yearHijriyah];
5
6  let yearNow = new Date().getFullYear();
7
8  for (let i = 0; i < 9999; i++) {
9    initializeHijriyah = initializeHijriyah + 1;
10    yearsHijriyah.push(initializeHijriyah);
11  }
12
13  const getIndexHijriyah = yearsHijriyah.indexOf(yearHijriyah);
14  const getSubstractYearHijriyah = Math.abs(
15    yearsHijriyah[getIndexHijriyah] - yearNow
16  );
17  const getYearHijriyah = Math.abs(getSubstractYearHijriyah - yearNow);
18  return getYearHijriyah;
19}