a forked and modify from Flatpickr
Feature Overview:
- Adds support for ROC (Republic of China) calendar
- Uses 't' as the format character for ROC dates, e.g., t-m-d
一個從 Flatpickr 進行修改的分支
功能概述:
- 增加對民國年的支援
- 使用 t 做為民國年的格式化字串, 如:t-m-d
Config Option | Type | Default | Description |
---|---|---|---|
year_tw | Boolean | false | Displays ROC era name and change year to ROC Year when enabled. |
Character | Description | Example |
---|---|---|
t | A full numeric representation of a ROC year | 88 or 113 |
First Step:
<link rel="stylesheet" href="./flatpickr.min.css" />
<script src="./flatpickr.min.js"></script>
<!-- optional -->
<script src="./l10n/zh_tw.js"></script>
Second Step: Default Locale - ROC Calendar:
var fp = flatpickr(".date", {
year_tw: true,
dateFormat: "t-m-d",
});
Traditional Chinese - ROC Calendar:
var fp = flatpickr(".date", {
locale: "zh_tw",
year_tw: true,
dateFormat: "t-m-d",
});
第一步:
<link rel="stylesheet" href="./flatpickr.min.css">
<script src="./flatpickr.min.js"></script>
<!-- optional -->
<script src="./l10n/zh_tw.js"></script>
第二步: 預設語系-民國年:
var fp = flatpickr(".date", {
year_tw: true,
dateFormat: "t-m-d",
});
繁體中文-民國年:
var fp = flatpickr(".date", {
locale: "zh_tw",
year_tw: true,
dateFormat: "t-m-d",
});
IE9 and up, Edge, iOS Safari 6+, Chrome 8+, Firefox 6+
Demos and documentation: https://flatpickr.js.org
flatpickr will never change its license, pester users for donations, or engage in other user-hostile behavior.
Nevertheless, if you enjoyed working with this library or if its made your life easier, you can buy me a cup of coffee :)