aerawatcorp / bikram

Pythonic date object, parser, converter to work with Bikram Samwat (Nepali) dates
https://bikram.readthedocs.io
MIT License
14 stars 10 forks source link

Have you considered reducing the map or using any other version to represent it ? #6

Closed acpmasquerade closed 6 years ago

acpmasquerade commented 6 years ago

I had done a similar converter few months ago, and when I was thinking of taking it to public, I found yours.

Upon curiosity, the first thing I checked was the map of dates :) My approach was something like this

2087-9-1 => December, 17 2030 | <span>२०८७ पौष १</span>
2087-10-1 => January, 15 2031 | <span>२०८७ माघ १</span>
2087-11-1 => February, 14 2031 | <span>२०८७ फाल्गुण १</span>
2087-12-1 => March, 16 2031 | <span>२०८७ चैत्र १</span>
2088-1-1 => April, 15 2031 | <span>२०८८ बैशाख १</span>
2088-2-1 => May, 15 2031 | <span>२०८८ जेठ १</span>
2088-3-1 => June, 15 2031 | <span>२०८८ आषाढ १</span>
2088-4-1 => July, 17 2031 | <span>२०८८ श्रावण १</span>
2088-5-1 => August, 18 2031 | <span>२०८८ भाद्र १</span>

The first date of the month in BS calendar stored with the equivalent Gregorian Calendar date.

poudel commented 6 years ago

I had wondered if there was a better way to represent the map but couldn't think of anything useful at the time of writing this. I can see how date-to-date map could work instead of the current one but don't see how it's better.

Having said that, even though the converter is a major part of this library, my main objective on writing it was to build an easy to use date object that I could pass around functions, and can perform calculations with the native date object. The converter was a necessary evil because the samwat object would not be useful without a conversion.

acpmasquerade commented 6 years ago

I liked the concept of have a utility around Bikram Sambat and that is portable with the native date objects. #Kudos. (The date-to-date map might not be better, it was the just the first thought I had :P)

Timezone is the next evil :)