amitgaru2 / nepali-datetime

Python's core datetime inspired Bikram Sambat (BS date) & Nepal Time (NPT) package🇳🇵
https://pypi.org/project/nepali-datetime/
MIT License
61 stars 30 forks source link

strftime to support nepali unicode completely #12

Closed amitgaru2 closed 3 years ago

amitgaru2 commented 4 years ago
neeket commented 4 years ago

Hello dxillar, Are you working on it?

amitgaru2 commented 4 years ago

@neeket Not started yet. just keeping track of it.

neeket commented 4 years ago

@dxillar I have one question regarding database (postgres) column for storing bs date. What datatype do you suggest for storing bs date in database?

amitgaru2 commented 4 years ago

@neeket I would recommend storing using Python's standard date module itself.. After fetching from database, convert it to BS date using the library. And before inserting any Nepali BS date, convert it to Python standard date then store..

This way you can preserve filtering behavior, as you can convert BS to AD before applying filter then again convert result date to BS to display to the user.

I hope you got it.

neeket commented 4 years ago

I believe you mean that we don't need to save BS date in database but rather save corresponding AD date. But would converting be good idea if there are thousands or lacs of rows and there is join of 4 or more tables?

What kind of enhancement & help do you need in this project?

amitgaru2 commented 4 years ago

That's a pretty good point.

What I suggest now is create a separate table where it contains AD & its corresponding BS date & create index on that AD date - if your application is too much of data intensive. Later whenever you are fetching data just join any table having AD with this new table on AD column so that you can get BS date.

AD BS
2020-11-05 2020-07-20

Store BS in string with the format you require.

Also why I recommended not directly storing BS as string field instead of AD as you suggested earlier is because, you won't be able to do the filters like date greater/lesser than, date between, & any other date related db queries ( if there exists more ).

The enhancement is mentioned in the title of this issue & there's a description too.

vector65536 commented 3 years ago
* support for days name ( like आइतबार सोमबार मंगलबार बुधवार बिहिबार शुक्रबार शनिबार )

* support for days & years digits ( like ०१२३४५६७८९, २०७५, २०७६, २०७७, ... )

Hi. this would be great!. Getting support for days name, comma-separated numbers in Unicode.