Skip to content

Commit

Permalink
doc(README): add remainingTime and fix verify legalId link issue (per…
Browse files Browse the repository at this point in the history
…sian-tools#130)

* update the readme file for remainingTime feature
* change doc for remainingTime
* remove logs from doc for remainingTime
  • Loading branch information
Amir-Alipour authored Jan 6, 2022
1 parent ad1ba21 commit d57c7ff
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- [Add and remove commas to numbers](#add-and-remove-commas).
- [Convert Persian numbers to Arabic or English numbers and vice versa](#convert-persian-numbers-to-arabic-or-english-numbers-and-vice-versa).
- [Validate Iranian national number(code-e Melli)](#validate-iranian-national-numbercode-e-melli).
- [Validate Iranian legal id(shenase hoghoghi)](#validate-iranian-legal-id).
- [Validate Iranian legal id(shenase hoghoghi)](#validate-iranian-legal-idshenase-hoghoghi).
- [Find city and province name by national code(code-e Melli)](#find-city-and-province-name-by-national-idcode-e-melli).
- [Bill calculator](#bill-calculator).
- [Check Iranian Sheba(IBAN) validation and recognize bank information by sheba code](#iranian-shebaiban).
Expand All @@ -33,6 +33,7 @@
- [Fix Persian characters in URL](#fix-persian-characters-in-url).
- [Fix Persian zero-width non-joiner(Replace spaces by half-space)](#fix-persian-zero-width-non-joinerreplace-spaces-by-half-space)
- [Convert Jalaali date-time into a time ago](#convert-jalaali-date-time-into-a-time-ago)
- [Get the Remaining Time of the Date](#get-the-remaining-time-of-the-date)
- [Validate and find information of phone number](#validate-and-find-information-of-phone-number).

## Getting started
Expand Down Expand Up @@ -415,6 +416,26 @@ timeAgo('1400/04/07 18:00:00') // حدود 3 هفته بعد
timeAgo('1401/03/17 18:00:00') // حدود 1 سال بعد
```

### Get the Remaining Time of the Date

**Usage**

>Takes a date(it could be string, number or date) and calculate years,
>months, days, hours, minutes and seconds remained to that specific date.
```js
import { remainingTime } from "@persian-tools/persian-tools";

remainingTime("2023-05-14T13:35:59Z").toString() // ۱ سال و ۱ ماه و ۲ روز و ۳ ساعت و ۵ دقیقه و ۸ ثانیه

const { years, months, days, hours, minutes, seconds, isFinished } = remainingTime("2023-05-14T13:35:59Z");
years // 1
minutes // 5
isFinished // false

remainingTime("2018-04-12T10:30:51Z").isFinished // true
```

### Validate and find information of phone number

**Usage**
Expand Down

0 comments on commit d57c7ff

Please sign in to comment.