Giter VIP home page Giter VIP logo

action-jdate's Introduction

Download/install the latest version of jdate

last-commit commit-activity

Jalali Calendar, developed by Ashkan Ghassemi, is:

... a small and portable free software library to manipulate date and time in Jalali calendar system.



- name: Installing jdate
  uses: davoudarsalani/action-jdate@master
  with:
    source: 'docker-jdate'  ## default

There are ten options for source:

  • Use docker image
    • docker-khayyam will pull khayyam docker image/repository (about 61.3MB in size) containing khayyam python module on Alpine Linux
    • docker-persiantools will pull persiantools docker image/repository (about 60.8MB in size) containing persiantools python module on Alpine Linux
    • docker-jdatetime will pull jdatetime docker image/repository (about 59.8MB in size) containing jdatetime python module on Alpine Linux
    • docker-jdate will pull jdate docker image/repository (about 8.22MB in size) containing jdate on Alpine Linux
  • Download tar.gz file
    • askapache will download from askapache.com
    • gnu will download from gnu.org
    • nongnu will download from nongnu.org
  • Clone git repository
    • clone-github will clone from github.com
    • clone-gnu will clone from gnu.org
    • clone-nongnu will clone from nongnu.org

For docker-khayyam, docker-persiantools or docker-jdatetime set as source, you may use either of the following commands respectively to set date/time:

## docker-khayyam
run: date_time="$(docker run --rm -t davoudarsalani/khayyam \
       python -c "import khayyam; print(khayyam.JalaliDatetime.now().strftime('%Y-%m-%d %H:%M:%S %A'))")"

## docker-persiantools
run: date_time="$(docker run --rm -t davoudarsalani/persiantools \
       python -c "from persiantools.jdatetime import JalaliDateTime; print(JalaliDateTime.now().strftime('%Y-%m-%d %H:%M:%S %A'))")"

## docker-jdatetime
run: date_time="$(docker run --rm -t davoudarsalani/jdatetime \
       python -c "import jdatetime; print(jdatetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S %A'))")"

Note: These three options, as mentioned earlier, use respective python modules.
The documents state that we can use the same format used for the datetime module:

khayyam: The package’s API is considered to be exactly the same as the datetime module, so if you are familiar with the datetime, you can read the Migration from python’s builtin datetime.

persiantools: Jalali (Shamsi) date and datetime (based on python datetime's module)

jdatetime: This module exactly follows Python Standard datetime module’s methods


Alternatively, if docker-jdate is set for source, you can use jdate command to get date/time:

- name: Getting date/time
  shell: bash
  run: date_time="$(docker run --rm -t davoudarsalani/jdate jdate '+%Y-%m-%d %H:%M:%S %A')"

Similarly, if the other options are chosen, you can use jdate command:

run: date_time="$(jdate '+%Y-%m-%d %H:%M:%S %A')"

Note: jdate and date share the same format.



action-jdate's People

Contributors

davoudarsalani avatar

Watchers

 avatar  avatar

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.