time-ago-tr
v1.0.0
Published
Convert timestamps into Turkish 'time ago' strings
Downloads
3
Maintainers
Readme
🕒 time-ago-tr
Convert a date or timestamp into a human-readable "time ago" string in Turkish.
Perfect for blog posts, comments, feeds, logs, or anywhere you want to show relative time in Turkish.
📦 Installation
Using npm
npm install time-ago-trUsing yarn
yarn add time-ago-tr🚀 Usage
const timeAgo = require("time-ago-tr");
// Returns: "az önce"
console.log(timeAgo(Date.now() - 5000));
// Returns: "1 dakika önce"
console.log(timeAgo(Date.now() - 60000));
// Returns: "2 saat önce"
console.log(timeAgo(Date.now() - 2 * 60 * 60 * 1000));
// Returns: "1 yıl önce"
console.log(timeAgo("2023-03-28"));⚙️ Options
There are no options required.
Just pass in a valid date string, Date object or timestamp.
| Input Type | Example |
|------------------|---------------------------------|
| Date | new Date() |
| string | "2024-03-28T10:00:00" |
| timestamp | 1711612800000 |
📤 Output Examples
az önce30 saniye önce5 dakika önce2 saat önce1 gün önce3 hafta önce2 ay önce1 yıl önceGeçersiz tarih
🧪 Test
node test.js🪪 License
MIT
---