-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(date-picker): support type="week" (#5061)
* feat(date-picker): add demo for week type * feat(date-picker): add localized placeholders & format * feat(date-picker): add weekFormat for zhCN * feat(data-picker): add css variable for calendarLeftPaddingWeek & calendarRightPaddingWeek * feat(date-picker): adjust format for zhCN * feat(date-picker): implement basic week * feat(date-picker): add style to hovered week * fix(date-picker): fix style issue * fix(date-picker): make hover effect correct * feat(date-picker): add enUS demo * chore(date-picker): add changelog * doc(date-picker): add demo to index of enUS doc * feat(date-picker): remove confirm for week type * fix(date-picker): remove single-day hover for week picker * chore(date-picker): add weekPlaceholder to locales * chore(date-picker): add weekFormat to locales * fix(date-picker): fix wrong firstDayOfWeek * fix(date-picker): remove console.log --------- Co-authored-by: 07akioni <[email protected]>
- Loading branch information
Showing
36 changed files
with
316 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ year.vue | |
yearrange.vue | ||
quarter.vue | ||
quarterrange.vue | ||
week.vue | ||
size.vue | ||
default-time.vue | ||
disabled.vue | ||
|
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,20 @@ | ||
<markdown> | ||
# Week | ||
</markdown> | ||
|
||
<template> | ||
<n-date-picker v-model:value="timestamp" type="week" clearable /> | ||
<pre>{{ JSON.stringify(timestamp) }}</pre> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, ref } from 'vue' | ||
export default defineComponent({ | ||
setup () { | ||
return { | ||
timestamp: ref(1183135260000) | ||
} | ||
} | ||
}) | ||
</script> |
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ year.vue | |
yearrange.vue | ||
quarter.vue | ||
quarterrange.vue | ||
week.vue | ||
size.vue | ||
default-time.vue | ||
disabled.vue | ||
|
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,20 @@ | ||
<markdown> | ||
# 周 | ||
</markdown> | ||
|
||
<template> | ||
<n-date-picker v-model:value="timestamp" type="week" clearable /> | ||
<pre>{{ JSON.stringify(timestamp) }}</pre> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, ref } from 'vue' | ||
export default defineComponent({ | ||
setup () { | ||
return { | ||
timestamp: ref(1183135260000) | ||
} | ||
} | ||
}) | ||
</script> |
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 |
---|---|---|
|
@@ -13,3 +13,4 @@ export type DatePickerType = | |
| 'monthrange' | ||
| 'quarterrange' | ||
| 'yearrange' | ||
| 'week' |
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.