-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1855 from iamkun/dev
D2M
- Loading branch information
Showing
13 changed files
with
514 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
Türkçe | [English](../../README.md) | [简体中文](../zh-cn/README.zh-CN.md) | [日本語](../ja/README-ja.md) | [Português Brasileiro](../pt-br/README-pt-br.md) | [한국어](../ko/README-ko.md) | [Español (España)](../es-es/README-es-es.md) | [Русский](../ru/README-ru.md) | ||
|
||
<p align="center"><a href="https://day.js.org/" target="_blank" rel="noopener noreferrer"><img width="550" | ||
src="https://user-images.githubusercontent.com/17680888/39081119-3057bbe2-456e-11e8-862c-646133ad4b43.png" | ||
alt="Day.js"></a></p> | ||
<p align="center">Aynı modern API ile <b>2kB</b> hızlı bir Moment.js alternatifi</p> | ||
<br> | ||
<p align="center"> | ||
<a href="https://unpkg.com/dayjs/dayjs.min.js"><img | ||
src="https://img.badgesize.io/https://unpkg.com/dayjs/dayjs.min.js?compression=gzip&style=flat-square" | ||
alt="Gzip Size"></a> | ||
<a href="https://www.npmjs.com/package/dayjs"><img src="https://img.shields.io/npm/v/dayjs.svg?style=flat-square&colorB=51C838" | ||
alt="NPM Version"></a> | ||
<a href="https://travis-ci.org/iamkun/dayjs"><img | ||
src="https://img.shields.io/travis/iamkun/dayjs/master.svg?style=flat-square" alt="Build Status"></a> | ||
<a href="https://codecov.io/gh/iamkun/dayjs"><img | ||
src="https://img.shields.io/codecov/c/github/iamkun/dayjs/master.svg?style=flat-square" alt="Codecov"></a> | ||
<a href="https://github.com/iamkun/dayjs/blob/master/LICENSE"><img | ||
src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="License"></a> | ||
<br> | ||
<a href="https://saucelabs.com/u/dayjs"> | ||
<img width="750" src="https://user-images.githubusercontent.com/17680888/40040137-8e3323a6-584b-11e8-9dba-bbe577ee8a7b.png" alt="Sauce Test Status"> | ||
</a> | ||
</p> | ||
|
||
> Day.js, büyük ölçüde Moment.js uyumlu bir API ile modern tarayıcılar için tarih ve saatleri dönüştüren, doğrulayan, işleyen ve görüntüleyen minimalist bir JavaScript kütüphanesidir. Moment.js kullanıyorsanız, Day.js'i nasıl kullanacağınızı zaten biliyorsunuzdur. | ||
```js | ||
dayjs() | ||
.startOf('month') | ||
.add(1, 'day') | ||
.set('year', 2018) | ||
.format('YYYY-MM-DD HH:mm:ss') | ||
``` | ||
|
||
- 🕒 Benzer Moment.js API & Kalıpları | ||
- 💪 Değişmez | ||
- 🔥 Zincirlenebilir | ||
- 🌐 I18n destekler | ||
- 📦 2kB boyutunda küçük bir kütaphane | ||
- 👫 Bütün tarayıcılarda desteklenir | ||
|
||
--- | ||
|
||
# Başlarken | ||
|
||
### Dökümantasyon | ||
|
||
Daha fazla bilgiye, API ve diğer dökümanlara [day.js.org](https://day.js.org/) websitesinden ulaşabilirsiniz. | ||
|
||
## Kurulum | ||
|
||
```console | ||
npm install dayjs --save | ||
``` | ||
|
||
📚[Kurulum Rehberi](https://day.js.org/docs/en/installation/installation) | ||
|
||
## API | ||
|
||
Tarihleri ve saatleri dönüştürmek, doğrulamak, işlemek ve görüntülemek için Day.js API'larını kullanmak kolaydır. | ||
|
||
```javascript | ||
dayjs('2018-08-08') // dönüştürme | ||
|
||
dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // belirli bir formatta görüntüleme | ||
|
||
dayjs() | ||
.set('month', 3) | ||
.month() // görüntüleme & değer atama | ||
|
||
dayjs().add(1, 'year') // değiştirme | ||
|
||
dayjs().isBefore(dayjs()) // sorgulama | ||
``` | ||
|
||
📚[API Referansı](https://day.js.org/docs/en/parse/parse) | ||
|
||
## I18n | ||
|
||
Day.js, uluslararasılaştırma için büyük desteğe sahiptir. | ||
|
||
Ancak siz kullanmadığınız sürece bunların hiçbiri yapınıza dahil edilmeyecektir. | ||
|
||
```javascript | ||
import 'dayjs/locale/es' // isteğe göre yükle | ||
|
||
dayjs.locale('tr') // yerel ayarı Türkçe olarak kullan | ||
|
||
dayjs('2018-05-05') | ||
.locale('zh-cn') | ||
.format() //belirli bir durum için Basitleştirilmiş Çince formatında görüntüleme | ||
``` | ||
|
||
📚[Uluslararasılaştırma](https://day.js.org/docs/en/i18n/i18n) | ||
|
||
## Eklenti | ||
|
||
Eklenti, işlevselliği genişletmek veya yeni özellikler eklemek için Day.js'e eklenebilen bağımsız bir modüldür. | ||
|
||
```javascript | ||
import advancedFormat from 'dayjs/plugin/advancedFormat' // isteğe göre yükle | ||
|
||
dayjs.extend(advancedFormat) // eklentiyi kullan | ||
|
||
dayjs().format('Q Do k kk X x') // diğer mevcut formatlar | ||
``` | ||
|
||
📚[Eklenti Listesi](https://day.js.org/docs/en/plugin/plugin) | ||
|
||
## Sponsorlar | ||
|
||
Sponsor olarak bu projeye destek olun. Logonuz, web sayfanızın linki ile birlikte burada görünür. [[Sponsor Ol](https://opencollective.com/dayjs#sponsor)] | ||
|
||
<a href="https://opencollective.com/dayjs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/0/avatar.svg"></a> | ||
<a href="https://opencollective.com/dayjs/sponsor/1/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/1/avatar.svg"></a> | ||
<a href="https://opencollective.com/dayjs/sponsor/2/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/2/avatar.svg"></a> | ||
<a href="https://opencollective.com/dayjs/sponsor/3/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/3/avatar.svg"></a> | ||
|
||
## Katkıda Bulunanlar | ||
|
||
Bu proje, katkıda bulunan tüm insanlar sayesinde mevcut. | ||
|
||
Lütfen bize destek olmak için projeye 💖 yıldız 💖 verin. Teşekkürler. | ||
|
||
Ve tüm destekçilerimize teşekkür ederiz! 🙏 | ||
|
||
<a href="https://opencollective.com/dayjs/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/0/avatar.svg?requireActive=false"></a> | ||
<a href="https://opencollective.com/dayjs/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/1/avatar.svg?requireActive=false"></a> | ||
<a href="https://opencollective.com/dayjs/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/2/avatar.svg?requireActive=false"></a> | ||
<a href="https://opencollective.com/dayjs/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/3/avatar.svg?requireActive=false"></a> | ||
<a href="https://opencollective.com/dayjs#backers" target="_blank"><img src="https://opencollective.com/dayjs/contributors.svg?width=890" /></a> | ||
|
||
## Lisans | ||
|
||
Day.js, bir [MIT Lisansı](../../LICENSE) altında lisanslanmıştır. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Bengali (Bangladesh) [bn-bd] | ||
import dayjs from 'dayjs' | ||
|
||
const symbolMap = { | ||
1: '১', | ||
2: '২', | ||
3: '৩', | ||
4: '৪', | ||
5: '৫', | ||
6: '৬', | ||
7: '৭', | ||
8: '৮', | ||
9: '৯', | ||
0: '০' | ||
} | ||
|
||
const numberMap = { | ||
'১': '1', | ||
'২': '2', | ||
'৩': '3', | ||
'৪': '4', | ||
'৫': '5', | ||
'৬': '6', | ||
'৭': '7', | ||
'৮': '8', | ||
'৯': '9', | ||
'০': '0' | ||
} | ||
|
||
const locale = { | ||
name: 'bn-bd', | ||
weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'), | ||
months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), | ||
weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), | ||
monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'), | ||
weekdaysMin: 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'), | ||
weekStart: 0, | ||
preparse(string) { | ||
return string.replace(/[১২৩৪৫৬৭৮৯০]/g, match => numberMap[match]) | ||
}, | ||
postformat(string) { | ||
return string.replace(/\d/g, match => symbolMap[match]) | ||
}, | ||
ordinal: (n) => { | ||
const s = ['ই', 'লা', 'রা', 'ঠা', 'শে'] | ||
const v = n % 100 | ||
return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]` | ||
}, | ||
formats: { | ||
LT: 'A h:mm সময়', | ||
LTS: 'A h:mm:ss সময়', | ||
L: 'DD/MM/YYYY খ্রিস্টাব্দ', | ||
LL: 'D MMMM YYYY খ্রিস্টাব্দ', | ||
LLL: 'D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়', | ||
LLLL: 'dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়' | ||
}, | ||
meridiem: hour => | ||
/* eslint-disable no-nested-ternary */ | ||
(hour < 4 | ||
? 'রাত' | ||
: hour < 6 | ||
? 'ভোর' | ||
: hour < 12 | ||
? 'সকাল' | ||
: hour < 15 | ||
? 'দুপুর' | ||
: hour < 18 | ||
? 'বিকাল' | ||
: hour < 20 | ||
? 'সন্ধ্যা' | ||
: 'রাত'), | ||
relativeTime: { | ||
future: '%s পরে', | ||
past: '%s আগে', | ||
s: 'কয়েক সেকেন্ড', | ||
m: 'এক মিনিট', | ||
mm: '%d মিনিট', | ||
h: 'এক ঘন্টা', | ||
hh: '%d ঘন্টা', | ||
d: 'এক দিন', | ||
dd: '%d দিন', | ||
M: 'এক মাস', | ||
MM: '%d মাস', | ||
y: 'এক বছর', | ||
yy: '%d বছর' | ||
} | ||
} | ||
|
||
dayjs.locale(locale, null, true) | ||
|
||
export default locale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.