Skip to content

Commit 9dbcf94

Browse files
committed
inital l l ll 🎉
1 parent 5875714 commit 9dbcf94

File tree

12 files changed

+843
-104
lines changed

12 files changed

+843
-104
lines changed

README.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1-
# vue-calendar
1+
# Vue Datepicker Component
2+
>A Datepicker Component For VueJs
23
3-
## Project setup
4-
```
5-
yarn install
4+
<img src="./resources/rangepicker.png" />
5+
<img src="./resources/singlepicker.png">
6+
<img src="./resources/rangePicker.gif">
7+
### Props
8+
``` html
9+
<Calendar
10+
v-model=""
11+
:range=""
12+
:lang=""
13+
:firstDayOfWeek=""
14+
:input-class=""
15+
:position=""
16+
:disabled-start-date=""
17+
:disabled-end-date=""
18+
:text-format=""
19+
:date-format=""/>
620
```
721

8-
### Compiles and hot-reloads for development
9-
```
10-
yarn run serve
11-
```
22+
Prop | Value
23+
------------- | -------------
24+
value (v-model) | Date or Array for range
25+
range | Boolean - (default: false)
26+
lang | String / Supports all languages / iso code language / default: 'tr'
27+
firstDayOfWeek | monday or sunday (default: monday)
28+
inputClass | String / classname for input
29+
position | String / options = top, bottom, left, right / default: left
30+
disabled-start-date | Object . This object consists of the start and end information(from and to params). ( For single status and range status of startDate). Default: { from: null, to: null}
31+
disabled-end-date | Object . It has the same with disabled-start-end. (For range status of end Date. Ignored in single status.)
32+
text-format | String / Short And Long / Short and long formats of month and day names
33+
date-format | Object / This is the format in which the selected date will be displayed to the user. / default: { day: '2-digit', month: 'long', year: 'numeric' }
1234

13-
### Compiles and minifies for production
14-
```
15-
yarn run build
16-
```
1735

18-
### Lints and fixes files
19-
```
20-
yarn run lint
21-
```
36+
#### note:
37+
**date-format** object values is consists to toLocaleString in js. (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString).

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
22
"name": "vue-calendar",
3+
"author": "edisdev <hedis285@gmail.com>",
34
"version": "0.1.0",
4-
"private": true,
5+
"private": false,
6+
"license": "MIT",
7+
"keywords": [
8+
"vue",
9+
"datepicker",
10+
"date-picker",
11+
"calendar",
12+
"component"
13+
],
14+
"homepage": "https://github.com/edisdev/vue-datepicker-ui",
15+
"repository": {
16+
"type": "git",
17+
"url": "git+https://github.com/edisdev/vue-datepicker-ui.git"
18+
},
519
"scripts": {
620
"serve": "vue-cli-service serve",
721
"build": "vue-cli-service build",

resources/rangePicker.gif

1.99 MB
Loading

resources/rangepicker.png

146 KB
Loading

resources/singlepicker.png

81.2 KB
Loading

src/App.vue

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

src/Example.vue

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
<template>
2+
<div id="app">
3+
<div class="titles">
4+
<h1>VUE DATEPCIKER COMPONENT</h1>
5+
<div class="using">
6+
<div>
7+
<span class="install">npm install vue-datepicker-component</span> or
8+
<span class="install">yarn add vue-datepicker-component</span>
9+
</div>
10+
<code class="code" v-html="exampleCode">
11+
</code>
12+
</div>
13+
<div class="viewCode">
14+
<a href="https://github.com/edisdev/vue-datepicker-ui" target="_blank">
15+
View Github Repository
16+
</a>
17+
<p>Thank you so much in advance for stars & supports. 😍👍
18+
</p>
19+
</div>
20+
</div>
21+
<div class="example"
22+
v-for="(example,index) in examples"
23+
:key="index">
24+
<h3>{{ example.title }}</h3>
25+
<Calendar
26+
v-model="example.value"
27+
:range="example.range"
28+
:lang="example.lang"
29+
:firstDayOfWeek="example.firstDayOfWeek"
30+
:input-class="example.inputClass"
31+
:position="example.position"
32+
:disabled-start-date="example.disabledStartDate"
33+
:text-format="example.textFormat"
34+
:date-format="example.dateFormat"
35+
:disabled-end-date="example.disabledEndDate"/>
36+
<blockquote class="exam-props">
37+
<textarea :value="JSON.stringify(example, null, 2)" readonly>
38+
</textarea>
39+
</blockquote>
40+
</div>
41+
</div>
42+
</template>
43+
44+
<script>
45+
import Calendar from './components/calendar.vue'
46+
47+
export default {
48+
name: 'app',
49+
components: {
50+
Calendar
51+
},
52+
data() {
53+
return {
54+
exampleCode: '< Calendar <br> v-model="example.value" <br> :range="example.range" <br> :lang="example.lang" <br> :firstDayOfWeek="example.firstDayOfWeek" <br> :input-class="example.inputClass" <br> :position="example.position" <br> :disabled-start-date="example.disabledStartDate" <br> :text-format="example.textFormat" <br> :date-format="example.dateFormat" <br> :disabled-end-date="example.disabledEndDate"/>',
55+
examples: [
56+
{ title: 'Single',
57+
inputClass: 'exampleDatePicker',
58+
lang: 'tr',
59+
position: 'bottom',
60+
range: false,
61+
value: new Date(),
62+
firstDayOfWeek: 'monday'
63+
},
64+
{ title: 'Range',
65+
inputClass: 'exampleDatePicker',
66+
lang: 'tr',
67+
position: 'bottom',
68+
range: true,
69+
value: [new Date(), new Date(new Date().getTime() + ( 9 * 24 * 60 * 60 * 1000))],
70+
firstDayOfWeek: 'monday'
71+
},
72+
{ title: 'Custom lang, First day of week',
73+
inputClass: 'exampleDatePicker',
74+
lang: 'en',
75+
position: 'right',
76+
range: true,
77+
value: [new Date(), new Date(new Date().getTime() + ( 9 * 24 * 60 * 60 * 1000))],
78+
firstDayOfWeek: 'sunday'
79+
},
80+
{ title: 'Disabled Status',
81+
inputClass: 'exampleDatePicker',
82+
lang: 'ar',
83+
position: 'top',
84+
disabledStartDate: {
85+
to: new Date(new Date().getTime() - ( 20 * 24 * 60 * 60 * 1000)),
86+
from: new Date(new Date().getTime() - ( 1 * 24 * 60 * 60 * 1000))
87+
},
88+
value: new Date(new Date().getTime() - ( 5 * 24 * 60 * 60 * 1000))
89+
},
90+
{ title: 'Date Options String',
91+
inputClass: 'exampleDatePicker',
92+
lang: 'en',
93+
position: 'left',
94+
textFormat: 'long',
95+
value: new Date()
96+
},
97+
{ title: 'Showed Date Format',
98+
inputClass: 'exampleDatePicker',
99+
lang: 'en',
100+
position: 'right',
101+
value: new Date(),
102+
dateFormat: {day: '2-digit', month: '2-digit', year: 'numeric'}
103+
},
104+
]
105+
}
106+
}
107+
}
108+
</script>
109+
110+
<style>
111+
* {
112+
box-sizing: border-box;
113+
padding: 0;
114+
margin: 0;
115+
}
116+
#app {
117+
font-family: 'Avenir', Helvetica, Arial, sans-serif;
118+
-webkit-font-smoothing: antialiased;
119+
-moz-osx-font-smoothing: grayscale;
120+
display: flex;
121+
width: 98vw;
122+
padding-top: 50px;
123+
padding-bottom: 200px;
124+
padding-left: 2vw;
125+
padding-right: 2vw;
126+
flex-wrap: wrap;
127+
}
128+
.titles {
129+
width: 98vw;
130+
border-bottom: 1px solid #dedeee;
131+
padding-bottom: 20px;
132+
text-align: center;
133+
}
134+
.titles .viewCode {
135+
margin-top: 10px;
136+
}
137+
.titles .viewCode a {
138+
color: #1bba67;
139+
font-weight: bold;
140+
}
141+
.titles .viewCode p {
142+
margin-top: 5px;
143+
font-weight: bold;
144+
}
145+
.titles .using {
146+
display: flex;
147+
flex-direction: column;
148+
align-items: center;
149+
margin-top: 20px;
150+
}
151+
.titles .using .install{
152+
font-size: 16px;
153+
background: #000;
154+
border-radius: 4px;
155+
color: #ffb00f;
156+
padding: 10px;
157+
}
158+
.titles .using .code {
159+
width: 40%;
160+
background: #000;
161+
display: block;
162+
align-self: center;
163+
color: #1bba67;
164+
padding: 20px;
165+
font-size: 16px;
166+
margin-top: 30px;
167+
border-radius: 4px;
168+
text-align: left;
169+
}
170+
171+
.example {
172+
padding-left: 3vw;
173+
min-width: 30vw;
174+
padding-top: 30px;
175+
border-bottom: 1px solid #eaeaeb;
176+
}
177+
.example:nth-child(3n-1) , .example:nth-child(3n) {
178+
border-right: 1px solid #eaeaeb;
179+
}
180+
.example h3 {
181+
margin-bottom: 20px;
182+
}
183+
.example .exam-props {
184+
height: 250px;
185+
margin-top: 20px;
186+
}
187+
188+
.example .exam-props textarea{
189+
margin-top: 20px;
190+
height: 200px;
191+
padding: 7px;
192+
border-radius: 6px;
193+
border-color: #eaeaeb;
194+
resize: none;
195+
width: 95%;
196+
}
197+
</style>

0 commit comments

Comments
 (0)