#momentjs

Umm al-Qura Hijri Date
Playing with Javascript

Displaying Gregorian and Hijri today’s date in Arabic format with [1] moment.js and [2] moment-hijri.js in browser:- JS HTML CSS Result <!-- 1- Load the moment-with-locales --> <script src="/jquery/dist/jquery.min.js"></script> <script src="/moment/min/moment-with-locales.min.js"></script> <script src="/moment-hijri/moment-hijri.js"></script> <script> // 2- Set the global locale to `ar-SA` moment.locale('ar-SA'); var m = moment(); // 3- use it normally: ١٤٣٧/٨/١٧هـ الموافق ٢٠١٦/٥/٢٤م //h = m.format('iYYYY/iM/iDهـ الموافق YYYY/M/Dم'); hijri = m.format('iD iMMMM iYYYYهـ'); gr = m.format('LL'); day = m.


Top