Skip to content

Commit cc97aee

Browse files
authored
Merge pull request #118 from phoenixwong/beta
Release v1.1.2
2 parents 905f94f + 58acf18 commit cc97aee

11 files changed

+1395
-1621
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
> The Change Log of Vue2 Timepicker `vue2-timepicker`
44
5+
## v 1.1.2
6+
7+
### New
8+
9+
More powerful `format` string parameter. E.g., you can hide the "hour" column by setting `format="mm:ss"`, or make AM/PM the first column by `format="A hh:ss"`, no extra CSS hacking needed. Please check the Demo page for more examples.
10+
11+
### Improvements
12+
13+
- Support `shift+tab` to navigate to the previous token slot in the Manual Input mode (Thanks to @jost-s).
14+
- Other minor keyboard navigation enhancements for Manual Input mode
15+
516
## v 1.1.1
617

718
### Improvements

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue2-timepicker-demo",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

demo/src/components/Samples.vue

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export default {
5252
autoScrollData1: '08:40',
5353
autoScrollData2: '5:30:20 pm',
5454
55+
apmFirst1: 'AM 03:15',
56+
apmFirst2: 'pm9時6分',
57+
5558
sideNav: [
5659
{ title: 'Default', anchor: 'default' },
5760
{ title: '12 Hours', anchor: 'format12hours' },
@@ -74,7 +77,8 @@ export default {
7477
{ title: '@focus and @blur event', anchor: 'focusAndBlur' },
7578
{ title: 'Customized Picker Labels', anchor: 'customPickerLabels' },
7679
{ title: 'Adjust Input Width', anchor: 'inputWidth' },
77-
{ title: 'Auto-Scroll', anchor: 'autoScroll' }
80+
{ title: 'Auto-Scroll', anchor: 'autoScroll' },
81+
{ title: 'More Powerful format String', anchor: 'morePowerfulFormat' }
7882
]
7983
}
8084
},
@@ -704,14 +708,14 @@ section#mostlyUsedSamples
704708
| <vue-timepicker hour-label="heure" minute-label="minute"></vue-timepicker>
705709
|
706710
| <!-- 12-hour format with customized am/pm text -->
707-
| <vue-timepicker hour-label="" minute-label="分" second-label="秒" apm-label="午" am-text="上午" pm-text="下午" format="h:mm:ss a"></vue-timepicker>
711+
| <vue-timepicker hour-label="" minute-label="分" second-label="秒" apm-label="午" am-text="上午" pm-text="下午" format="h:mm:ss a"></vue-timepicker>
708712
template(v-slot:preview)
709713
b 24-hour format with customized hour and minute label
710714
p
711715
vue-timepicker(hour-label="heure" minute-label="minute")
712716
b 12-hour format with customized am/pm text
713717
p
714-
vue-timepicker(hour-label="" minute-label="分" second-label="秒" apm-label="午" am-text="上午" pm-text="下午" format="h:mm:ss a")
718+
vue-timepicker(hour-label="" minute-label="分" second-label="秒" apm-label="午" am-text="上午" pm-text="下午" format="h:mm:ss a")
715719

716720
//- Adjust Input Width
717721
sample-block#inputWidth
@@ -765,6 +769,80 @@ section#mostlyUsedSamples
765769
p
766770
vue-timepicker(auto-scroll format="h:mm:ss a" v-model="autoScrollData2")
767771

772+
//- More Powerful format String
773+
sample-block#morePowerfulFormat
774+
template(v-slot:title) More Powerful <code>format</code> String
775+
template(slot="description")
776+
p The <code>format</code> parameter becomes even more powerful started from <code>v1.1.2</code>.
777+
template(v-slot:codes)
778+
highlight-code(lang="html" data-title="HTML")
779+
pre
780+
| &lt;!-- Use without "hour" --&gt;
781+
| &lt;vue-timepicker format="mm:ss"&gt;&lt;/vue-timepicker&gt;
782+
| &lt;vue-timepicker format="m:s"&gt;&lt;/vue-timepicker&gt;
783+
| &nbsp;
784+
| &lt;!-- Make AM/PM the first column in the dropdown --&gt;
785+
| &lt;vue-timepicker format="A hh:mm" v-model="apmFirst1"&gt;&lt;/vue-timepicker&gt;
786+
| &lt;vue-timepicker format="ah時m分" v-model="apmFirst2" am-text="午前" pm-text="午後"&gt;&lt;/vue-timepicker&gt;
787+
| &nbsp;
788+
| &lt;!-- Hour + APM only --&gt;
789+
| &lt;vue-timepicker format="ha"&gt;&lt;/vue-timepicker&gt;
790+
| &lt;vue-timepicker format="hh A"&gt;&lt;/vue-timepicker&gt;
791+
| &nbsp;
792+
| &lt;!-- One slot only --&gt;
793+
| &lt;!-- Not recommended, though :) --&gt;
794+
| &lt;vue-timepicker format="h" input-width="60px"&gt;&lt;/vue-timepicker&gt;
795+
| &lt;vue-timepicker format="mm" input-width="60px"&gt;&lt;/vue-timepicker&gt;
796+
| &lt;vue-timepicker format="ss" input-width="60px"&gt;&lt;/vue-timepicker&gt;
797+
| &lt;vue-timepicker format="a" input-width="60px"&gt;&lt;/vue-timepicker&gt;
798+
highlight-code(lang="javascript" data-title="JS")
799+
pre
800+
| // Initial values
801+
| data () {
802+
| return {
803+
| apmFirst1: 'AM 03:15',
804+
| // -> Equivalent to:
805+
| // apmFirst1: {
806+
| // A: 'AM',
807+
| // hh: '03',
808+
| // mm: '15'
809+
| // }
810+
|
811+
| apmFirst2: 'pm9時6分'
812+
| // -> Equivalent to:
813+
| // apmFirst2: {
814+
| // a: 'pm',
815+
| // h: '9',
816+
| // m: '6'
817+
| // }
818+
| }
819+
| }
820+
template(v-slot:preview)
821+
b Use without "hour"
822+
p
823+
vue-timepicker(format="mm:ss")
824+
| &nbsp;
825+
vue-timepicker(format="m:s")
826+
b Make AM/PM the first column in the dropdown
827+
p
828+
vue-timepicker(format="A hh:mm" v-model="apmFirst1")
829+
| &nbsp;
830+
vue-timepicker(format="ah時m分" v-model="apmFirst2" am-text="午前" pm-text="午後")
831+
b Hour + APM only
832+
p
833+
vue-timepicker(format="ha")
834+
| &nbsp;
835+
vue-timepicker(format="hh A")
836+
b One slot only
837+
p
838+
vue-timepicker(format="h" input-width="60px")
839+
| &nbsp;
840+
vue-timepicker(format="mm" input-width="60px")
841+
| &nbsp;
842+
vue-timepicker(format="ss" input-width="60px")
843+
| &nbsp;
844+
vue-timepicker(format="a" input-width="60px")
845+
768846
//- Footer Links
769847
.footer-links
770848
slot(name="footer-links")

0 commit comments

Comments
 (0)