Git Product home page Git Product logo

persiantools's People

Contributors

hasanisaeed avatar hramezani avatar majiidd avatar mhajiloo avatar mohsendor avatar mortezarastegarrad avatar pre-commit-ci[bot] avatar soheildsh avatar theyahya avatar zeoses avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

persiantools's Issues

Add CHANGELOG

hi
thanks for publishing this package
please create and update CHANGELOG file

to_jalali tzname error

Hey.

Code:

from django.utils import timezone
JalaliDateTime.to_jalali(self.created_at, tzinfo=timezone.tzinfo).strftime('%d %B %Y - %H:%M', locale='fa')

Execption:

tzname(dt) argument must be a datetime instance or None, not JalaliDateTime

wrong conversion in JalaliDate() (Gregorian to Jalali) on version 4.0.0

wrong conversion in JalaliDate() (Gregorian to Jalali) on version 4.0.0

Hi my friend.
Converting from Gregorian to Jalali Date in a specific date which has repeated every 4 years returns wrong result.
Wrong dates are exactly one year before the Jalali leap years (سال کبیسه).
see below examples:

from persiantools.jdatetime import JalaliDate
import datatime

print(JalaliDate(datatime.date(2020, 3, 18)))  # 1398-12-28 (correct)
print(JalaliDate(datatime.date(2020, 3, 19)))  # 1398-12-29 (correct)
print(JalaliDate(datatime.date(2020, 3, 20)))  # 1398-01-01 (incorrect) --> should be 1399-01-01
print(JalaliDate(datatime.date(2020, 3, 21)))  # 1399-01-02 (correct)

Converting all these days will give incorrect results and the result should be one year ahead:

...
2024, 3, 20
2020, 3, 20
2016, 3, 20
2012, 3, 20
...

Version 3.0.1 has no problems.

strptime implementation

Hi there,
Since there is no implementation for strptime function, I wonder is there any alternative way for converting string to date object?

Installation problem on conda

Hello,

I tried to install this package on my conda environment by typing:
conda install persiantools

But it fails:

$ conda install persiantools
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - persiantools

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Is there any solution?

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.