1.1.0 • Published 5 years ago

jalalify v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

jalalify

Detects and converts dates in the input stream from Gregorian to Jalali and vice versa.

Install

npm install -g jalalify

Usage

jalalify [-x] [-f <format>]

The default format is YYYY-M-D.

Example

Convert Gregorian dates in the input stream to Jalali:

echo -n 'I was born on 1982-4-1.' | jalalify

# Output:
# I was born on 1361-1-12.

Convert Jalali dates in the input stream to Gregorian:

echo -n 'I was born on 1361-1-12.' | jalalify -x

# Output:
# I was born on 1982-4-1.

Custom date format:

echo -n 'I was born on April 1, 1982.' | jalalify -f 'MMMM D, YYYY'

# Output:
# I was born on Farvardin 12, 1361.

Format Specifiers

SpecifierExampleDescription
YYYY19824-digit year
MMMMAprilMonth name
MMMAprShort month name
MM012-digit month number
M1Month number
DD012-digit day of month
D1Day of month

Version History

  • 1.1 + Added support for MM and DD format specifiers.
  • 1.0 + Initial release.

Author

Soheil Rashidi

Copyright and License

Copyright 2015 Soheil Rashidi

Licensed under the The MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.opensource.org/licenses/mit-license.php

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.