Skip to content

Commit 7db19ce

Browse files
committed
add prettier settings
1 parent 4ca5e1e commit 7db19ce

16 files changed

Lines changed: 282 additions & 323 deletions

.babelrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"presets": [
3-
[
4-
"@babel/preset-env"
5-
]
6-
]
2+
"presets": [["@babel/preset-env"]]
73
}

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- add_ssh_keys:
1919
fingerprints:
20-
- "01:d4:20:47:76:5b:80:99:96:2b:c4:20:54:ba:c4:d8"
20+
- "17:16:87:45:9e:a8:89:a1:c2:ed:62:72:7b:dc:fa:ed"
2121
- checkout
2222
- run: yarn install
2323
- run: yarn docs

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintrc

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,22 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"es6": true,
5-
"node": true
6-
},
7-
"extends": [
8-
"plugin:vue/essential",
9-
"standard"
10-
],
11-
"globals": {
12-
"Atomics": "readonly",
13-
"SharedArrayBuffer": "readonly"
14-
},
15-
"parserOptions": {
16-
"ecmaVersion": 2018,
17-
"sourceType": "module"
18-
},
19-
"plugins": [
20-
"vue"
21-
],
22-
"rules": {
23-
"quotes": [
24-
"error",
25-
"single"
26-
],
27-
"indent": [
28-
"error",
29-
2
30-
],
31-
"vue/script-indent": [
32-
"error",
33-
2,
34-
{
35-
"baseIndent": 1
36-
}
37-
]
38-
},
39-
"overrides": [
40-
{
41-
"files": [
42-
"*.vue"
43-
],
44-
"rules": {
45-
"indent": "off"
46-
}
47-
}
48-
]
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": ["plugin:vue/essential", "standard"],
8+
"globals": {
9+
"Atomics": "readonly",
10+
"SharedArrayBuffer": "readonly"
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 2018,
14+
"sourceType": "module"
15+
},
16+
"plugins": ["vue"],
17+
"rules": {
18+
"quotes": ["error", "single"],
19+
"indent": ["error", 2],
20+
"space-before-function-paren": 0
21+
}
4922
}

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
dist/
3+
docs/
4+
node_modules/

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true
6+
}

README.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# vuetify-datetime-picker
2+
23
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/darrenfang/vuetify-datetime-picker/blob/master/LICENSE)
34
[![npm version](https://img.shields.io/npm/v/vuetify-datetime-picker.svg?style=flat)](https://www.npmjs.com/package/vuetify-datetime-picker)
45
[![CircleCI](https://img.shields.io/circleci/project/github/darrenfang/vuetify-datetime-picker.svg)](https://circleci.com/gh/darrenfang/vuetify-datetime-picker)
56

67
DatetimePicker component for Vuetify.js.
78

8-
[Use this for Vuetify 1.5.x.](https://github.com/darrenfang/vuetify-datetime-picker/tree/v1.x "Use this for Vuetify 1.5.x.")
9+
[Use this for Vuetify 1.5.x.](https://github.com/darrenfang/vuetify-datetime-picker/tree/v1.x 'Use this for Vuetify 1.5.x.')
910

10-
[Online Demo](http://darrenfang.github.io/vuetify-datetime-picker/ "Online Demo")
11+
[Online Demo](http://darrenfang.github.io/vuetify-datetime-picker/ 'Online Demo')
1112

1213
## Installation
1314

@@ -32,43 +33,40 @@ Vue.use(DatetimePicker)
3233
Once installed, it can be used in a template as simply as:
3334

3435
```html
35-
<v-datetime-picker
36-
label="Select Datetime"
37-
v-model="datetime">
38-
</v-datetime-picker>
36+
<v-datetime-picker label="Select Datetime" v-model="datetime"> </v-datetime-picker>
3937
```
4038

4139
## Properties
4240

43-
| Name | Type | Default Value | Description |
44-
| ------------------ | ------------- | ------------------- | -------------------------------------------------------------------------------------- |
45-
| datetime (model) | Date/String | | Time picker model. |
46-
| disabled | Boolean | false | Input is disabled. |
47-
| label | string | | Sets input label. |
48-
| width | Number | 340 | The width of the content. |
49-
| format | string | YYYY-MM-DD HH:mm:ss | Defines the format of a datetime displayed in field. |
50-
| timePickerFormat | string | 24hr | Defines the format of a time displayed in picker. Available options are ampm and 24hr. |
51-
| locale | string | en-us | Sets the locale. Accepts a string with a BCP 47 language tag. |
52-
| okText | string | OK | Sets the text of the ok button. |
53-
| clearText | string | CLEAR | Sets the text of the clear button. |
54-
| loading | Boolean | false | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
55-
| errorMessages | String/Array | | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
56-
| errorCount | Number/String | 1 | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
57-
| error | Boolean | false | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
58-
| hideDetails | Boolean | false | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
59-
| appendIcon | String | | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
60-
| prependIcon | String | | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields "Vuetify Docs") |
41+
| Name | Type | Default Value | Description |
42+
| ---------------- | ------------- | ------------------- | --------------------------------------------------------------------------------------- |
43+
| datetime (model) | Date/String | | Time picker model. |
44+
| disabled | Boolean | false | Input is disabled. |
45+
| label | string | | Sets input label. |
46+
| width | Number | 340 | The width of the content. |
47+
| format | string | YYYY-MM-DD HH:mm:ss | Defines the format of a datetime displayed in field. |
48+
| timePickerFormat | string | 24hr | Defines the format of a time displayed in picker. Available options are ampm and 24hr. |
49+
| locale | string | en-us | Sets the locale. Accepts a string with a BCP 47 language tag. |
50+
| okText | string | OK | Sets the text of the ok button. |
51+
| clearText | string | CLEAR | Sets the text of the clear button. |
52+
| loading | Boolean | false | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
53+
| errorMessages | String/Array | | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
54+
| errorCount | Number/String | 1 | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
55+
| error | Boolean | false | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
56+
| hideDetails | Boolean | false | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
57+
| appendIcon | String | | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
58+
| prependIcon | String | | see [Vuetify Docs](https://vuetifyjs.com/zh-Hans/components/text-fields 'Vuetify Docs') |
6159

6260
## Events
6361

64-
| Name | Arguments | Description |
65-
| -----------| -----------------------| ------------------------ |
66-
| input | value (Date/String) | The updated bound model |
62+
| Name | Arguments | Description |
63+
| ----- | ------------------- | ----------------------- |
64+
| input | value (Date/String) | The updated bound model |
6765

6866
## Slots
6967

70-
| Name | Description |
71-
| -----------| ----------------------------------------- |
72-
| dateIcon | Slot to put custom icon in the date tab. |
73-
| timeIcon | Slot to put custom icon in the time tab. |
74-
| actions | Slot to put custom buttons in the dialog. |
68+
| Name | Description |
69+
| -------- | ----------------------------------------- |
70+
| dateIcon | Slot to put custom icon in the date tab. |
71+
| timeIcon | Slot to put custom icon in the time tab. |
72+
| actions | Slot to put custom buttons in the dialog. |

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"file-loader": "^4.2.0",
3636
"html-webpack-plugin": "^3.2.0",
3737
"less-loader": "^5.0.0",
38+
"prettier": "1.18.2",
3839
"sass": "^1.22.10",
3940
"sass-loader": "^7.2.0",
4041
"stylus": "^0.54.5",

src/app.vue

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,59 @@
11
<template>
2-
<v-app dark>
3-
<v-container>
4-
<v-layout row justify-center>
5-
<v-flex xs4>
6-
<v-datetime-picker v-model="datetime"></v-datetime-picker>
7-
</v-flex>
8-
</v-layout>
9-
<v-layout row justify-center>
10-
<v-flex xs4>
11-
<v-datetime-picker v-model="datetimeString"></v-datetime-picker>
12-
</v-flex>
13-
</v-layout>
14-
<v-layout row justify-center>
15-
<v-flex xs4>
16-
<v-datetime-picker datetime="2018-01-01 00:00:00" :disabled="true"></v-datetime-picker>
17-
</v-flex>
18-
</v-layout>
19-
<v-layout row justify-center>
20-
<v-flex xs4>
21-
<span class="subheading">Custom Buttons</span>
22-
<v-datetime-picker v-model="datetime">
23-
<template slot="actions"
24-
slot-scope="{ parent }"
25-
>
26-
<v-btn color="error lighten-1" flat @click.native="parent.clearHandler">Cancel</v-btn>
27-
<v-btn color="success darken-1" flat @click="parent.okHandler">Done</v-btn>
28-
</template>
29-
</v-datetime-picker>
30-
</v-flex>
31-
</v-layout>
32-
<v-layout row justify-center>
33-
<v-flex xs4>
34-
<span class="subheading">Custom Icons</span>
35-
<v-datetime-picker v-model="datetime">
36-
<template slot="dateIcon">
37-
<v-icon>fas fa-calendar</v-icon>
38-
</template>
39-
<template slot="timeIcon">
40-
<v-icon>fas fa-clock</v-icon>
41-
</template>
42-
</v-datetime-picker>
43-
</v-flex>
44-
</v-layout>
45-
</v-container>
46-
</v-app>
2+
<v-app dark>
3+
<v-container>
4+
<v-layout row justify-center>
5+
<v-flex xs4>
6+
<v-datetime-picker v-model="datetime"></v-datetime-picker>
7+
</v-flex>
8+
</v-layout>
9+
<v-layout row justify-center>
10+
<v-flex xs4>
11+
<v-datetime-picker v-model="datetimeString"></v-datetime-picker>
12+
</v-flex>
13+
</v-layout>
14+
<v-layout row justify-center>
15+
<v-flex xs4>
16+
<v-datetime-picker datetime="2018-01-01 00:00:00" :disabled="true"></v-datetime-picker>
17+
</v-flex>
18+
</v-layout>
19+
<v-layout row justify-center>
20+
<v-flex xs4>
21+
<span class="subheading">Custom Buttons</span>
22+
<v-datetime-picker v-model="datetime">
23+
<template slot="actions" slot-scope="{ parent }">
24+
<v-btn color="error lighten-1" flat @click.native="parent.clearHandler">Cancel</v-btn>
25+
<v-btn color="success darken-1" flat @click="parent.okHandler">Done</v-btn>
26+
</template>
27+
</v-datetime-picker>
28+
</v-flex>
29+
</v-layout>
30+
<v-layout row justify-center>
31+
<v-flex xs4>
32+
<span class="subheading">Custom Icons</span>
33+
<v-datetime-picker v-model="datetime">
34+
<template slot="dateIcon">
35+
<v-icon>fas fa-calendar</v-icon>
36+
</template>
37+
<template slot="timeIcon">
38+
<v-icon>fas fa-clock</v-icon>
39+
</template>
40+
</v-datetime-picker>
41+
</v-flex>
42+
</v-layout>
43+
</v-container>
44+
</v-app>
4745
</template>
4846

4947
<script>
50-
import moment from 'moment'
51-
import '@fortawesome/fontawesome-free/css/all.css'
48+
import moment from 'moment'
49+
import '@fortawesome/fontawesome-free/css/all.css'
5250
53-
export default {
54-
data () {
55-
return {
56-
datetime: new Date(),
57-
datetimeString: moment().format('YYYY-MM-DD HH:mm:ss')
58-
}
51+
export default {
52+
data() {
53+
return {
54+
datetime: new Date(),
55+
datetimeString: moment().format('YYYY-MM-DD HH:mm:ss')
5956
}
6057
}
58+
}
6159
</script>

0 commit comments

Comments
 (0)