Help

3

Pycalverter - Python Calendar Converter. Any one know how to implement this tool?

Avatar
Remya

pyCalverter (Python Calendar Converter) is a tool for python developers that need to use Persian(Jalali) or Hijri(Islamic) Calendar in their programs .

On the other side this tool can convert these calendars (hijri, jalahi, gregorian) together .

Bayazee pycalverter

Launchpad pycalverter

Please check the above two links.

Avatar
Discard
1 Answer
0
Avatar
Yug Faa
Best Answer

Hi,

Copy the file calverter.py into your module

In the file __init__.py import the file :

import calverter

In your code re-import calverter using the path of your module and type :

cal = calverter.calverter()
jd = cal.gregorian_to_jd(2014, 04 , 23)
print jd
print cal.jd_to_islamic(jd)

The outopu will be :

2456770.5
(1435, 6, 22)

I implemeted it for my module and it works well.

7 Comments
Avatar
Discard
Avatar
Remya
-

Thanks for your reply Yug Faa. Shall i ask you a doubt? i created two char fields for both islamic date and gregorian date. When i enter islamic date on islamic date field, it should convert into geogorian & display in gregorian date field. How should i wrote python code for that? Please help me.

Avatar
Yug Faa
-

Firstly fi this help you, please make it resolved, for the next problem the georgian date have to be a date field and for the islamic is char, you can use on_change feature or make the georgian field as function

Avatar
charlesraj
-

hi Yug Faa .. please check this py file. import calverter

class convertor_convertor(osv.osv): _description = "converting dates" _name = "convertor" { cal = calverter.calverter() jd = cal.gregorian_to_jd(2014, 04 , 23) print jd print cal.jd_to_islamic(jd) }

convertor_convertor()

Avatar
charlesraj
-

please tell me is this is the correct form of our code.

Avatar
charlesraj
-

hi i implement this code syntax error at cal = calverter.calverter() , How to solve this.

Avatar
Yug Faa
-

can you paste you code in pastebin.com and post the link here ? but before can you make this question SOLVED !

Avatar
charlesraj
-

no . I did n't make this here is the link. http://pastebin.com/tcAyKUG9