Giter VIP home page Giter VIP logo

hijri's Introduction

Umm Alqura Hijri Calendar Converter (1420-1450 A.H.)

Usage:

Include it in your page: <script src="hijri.js"></script>

Then in your own scripts:

H('2013-4-6')			//=> '1434-05-25'
H('2013-04-06')			//=> '1434-05-25'
H(2013,4,6)				//=> '1434-05-25'
H([2013,4,6])			//=> '1434-05-25'
H(['2013','4','6'])		//=> '1434-05-25'
H(1365195600000)		//=> '1434-05-25'
H(new Date(2013,3,6))	//=> '1434-05-25'
H()						//=>  equivalent to H(new Date())



H('2013-04-06', {type:'string'}) 	//=> '1434-05-25'	// DEFAULT
H('2013-04-06', {type:'array'}) 	//=> [1434, 5, 25]
H('2013-04-06', {type:'object'}) 	//=> {y:1434, m:5, d:25}
H('2013-04-06', {type:'json'}) 		//=> {"y":"1434", "m":"5", "d":"25"}

// requires Hijri Class --Under Development
H('2013-04-06', {type:'date'}) 		//=> new Hijri(1434,4,25)

===========================================================================

G('1434-5-25')			//=> '2013-04-06'
G('1434-05-25')			//=> '2013-04-06'
G(1434,5,25)			//=> '2013-04-06'
G([1434,5,25])			//=> '2013-04-06'
G(['1434','5','25'])	//=> '2013-04-06'
G(1365195600000)		//=> '2013-04-06'
G()						//=>  equivalent to G((new Date()).getTime())

// requires Hijri Class --Under Development
G(new Hijri(1434,4,25))	//=> '2013-04-06'



G('1434-05-25', {type:'string'}) 	//=> '2013-04-06'	// DEFAULT
G('1434-05-25', {type:'array'}) 	//=> [2013, 4, 6]
G('1434-05-25', {type:'object'}) 	//=> {y:2013, m:4, d:6}
G('1434-05-25', {type:'json'}) 		//=> '{"y":2013, "m":4, "d":6}'
G('1434-05-25', {type:'date'}) 		//=> new Date(2013,3,6)

In development:

Hijri() Class that mirrors javascript's native Date() Class as specified in the ECMAScript Specification (http://www.ecma-international.org/ecma-262/5.1/#sec-15.9).

hijri's People

Contributors

alnafie avatar

Stargazers

Muhammad Ramzan Ali Suzan avatar Yasir Nageeb avatar Khaled Al-Ansari avatar Abdulsalam alblihi avatar Abdullah Alhoshan avatar mulder yu avatar Cem Yabansu avatar Mahdi Bagheri avatar Mahmoud Sami avatar Usama Nada avatar Sarwan avatar  avatar

Watchers

James Cloos avatar  avatar Med Said BARA avatar  avatar  avatar

hijri's Issues

Years Before 1995 return TypeError!

H('1980-07-07');
hijri.js:448 Uncaught TypeError: Cannot read property 'split' of undefined
at H (hijri.js:448)
at :1:1
H @ hijri.js:448
(anonymous) @ VM336:1

G('1415-9-7');
hijri.js:384 Uncaught TypeError: Cannot read property 'split' of undefined
at G (hijri.js:384)
at :1:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.