This question has been flagged
1 Reply
10726 Views

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

Hi
I am working on localization modules in Iran
The name of the project is fadoo and a group of Iranian programmers will be added to this team soon

https://github.com/FadooIR
https://github.com/FadooIR/l10n-iran
https://github.com/OCA/l10n-iran
http://fadoo.ir/en/

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.

Avatar
Discard
Author

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.

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

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()

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

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

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

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