kalender hijriyah javascript

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

showing results for - "kalender hijriyah javascript"
Ella
27 Oct 2017
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}