You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add date and time conversion support with new tests
- Implemented `convertDateToWords` method for converting both Jalali and Gregorian dates into Persian words.
- Added `convertTimeToWords` method to convert digital time strings ("HH:mm") to Persian words.
- Introduced `customTimePrefix` option for customizing the time prefix (default "ساعت").
- Updated tests to cover new date and time conversion functionalities.
- Updated documentation and usage examples in the README.
**تبدیل عدد، تاریخ و زمان به حروف فارسی با TypeScript**
5
4
6
5
📘 English & فارسی Documentation
7
6
8
7
---
9
8
10
9
## 📦 Overview | نمای کلی
11
10
12
-
**Harfizer** is a modern, TypeScript-native package for converting numbers into their **Persian word** representation. It supports integers, decimals, and negative numbers, with rich customization options including separators, lexicons, and decimal suffixes.
13
-
14
-
**Harfizer** یک پکیج تایپاسکریپتی مدرن برای تبدیل اعداد به **حروف فارسی** است. این پکیج از اعداد صحیح، اعشاری و منفی پشتیبانی میکند و با ارائه گزینههای متنوع، امکان سفارشیسازی کامل خروجی را فراهم میسازد.
15
-
16
-
---
11
+
**Harfizer** is a modern, TypeScript-native package for converting numbers into their **Persian word** representation.
12
+
It supports integers, decimals, and negative numbers with rich customization options (such as separators, lexicons, and decimal suffixes).
17
13
18
-
## 🙏 Acknowledgements | قدردانی
14
+
In addition to number conversion, Harfizer now supports converting dates and digital time strings into Persian words.
15
+
This means you can now convert both dates (Solar/Jalali or Gregorian) and digital time (HH:mm) to their Persian word equivalents.
19
16
20
-
We extend our sincere thanks to the creators of the [num2persian](https://www.npmjs.com/package/num2persian) package — an excellent JavaScript utility that made number-to-Persian-word conversion accessible years ago. Inspired by their work, we created **Harfizer** to provide a fully typed, flexible, and extensible solution for modern TypeScript-based applications.
17
+
**Harfizer** یک پکیج تایپاسکریپتی مدرن برای تبدیل اعداد به **حروف فارسی** است.
18
+
این پکیج از اعداد صحیح، اعشاری و منفی پشتیبانی میکند و با ارائه گزینههای متنوع، امکان سفارشیسازی کامل خروجی (مانند جداکنندهها، واژگان و پسوندهای اعشاری) را فراهم میسازد.
21
19
22
-
ما صمیمانه از تیم پکیج [num2persian](https://www.npmjs.com/package/num2persian) تشکر میکنیم؛ ابزاری ارزشمند که سالها پیش امکان تبدیل اعداد به حروف فارسی را در جاوااسکریپت فراهم کرد. به عنوان یک برنامهنویس که درگیر توسعهی نرمافزارهای فارسیزبان هستم، وظیفه خود دانستم تا نسخهای مدرن، امن و قابل گسترش برای TypeScript توسعه دهم و آن را با جامعه به اشتراک بگذارم.
20
+
همچنین، Harfizer از تبدیل تاریخها و زمان دیجیتال به حروف فارسی پشتیبانی میکند.
21
+
این بدان معناست که اکنون میتوانید تاریخ (شمسی/میلادی) و زمان (به فرمت HH:mm) را به معادل حروف فارسی آنها تبدیل کنید.
### Convert Triple Digits Only | تبدیل تنها ارقام سه رقمی
153
197
154
198
```ts
155
-
converter.convertTripleToWords(215);
199
+
console.log(converter.convertTripleToWords(215));
156
200
// خروجی: "دویست و پانزده"
157
201
```
158
202
159
203
---
160
-
## 📆 Date Conversion | تبدیل تاریخ
161
-
162
-
Harfizer now supports converting dates to their Persian word representation using the `convertDateToWords` method. This method accepts a date string in either `YYYY/MM/DD` or `YYYY-MM-DD` format, along with an optional calendar type (`"jalali"` for Solar dates or `"gregorian"` for Gregorian dates, default is `"jalali"`).
163
204
164
-
Harfizer اکنون از تبدیل تاریخ به حروف فارسی پشتیبانی میکند. با استفاده از متد `convertDateToWords` میتوانید تاریخها را به رشتهای از حروف تبدیل کنید. این متد یک رشته تاریخ به فرمت `YYYY/MM/DD` یا `YYYY-MM-DD` و یک پارامتر تقویم اختیاری (`"jalali"` برای تاریخ شمسی یا `"gregorian"` برای تاریخ میلادی، پیشفرض `"jalali"`) را دریافت میکند.
205
+
## 📆 Date Conversion | تبدیل تاریخ
165
206
166
-
### Example | مثال
207
+
Harfizer supports converting dates to their Persian word representation using the `convertDateToWords` method.
208
+
This method accepts a date string in either `YYYY/MM/DD` or `YYYY-MM-DD` format and an optional calendar type:
209
+
-`"jalali"` for Solar dates (default)
210
+
-`"gregorian"` for Gregorian dates
167
211
168
212
```ts
169
213
import { HarfizerConverter } from'harfizer';
170
214
171
215
const converter =newHarfizerConverter();
172
216
173
-
// Convert a Jalali (Solar) date using dash format:
0 commit comments