Litepie Datepicker is a date range picker component for Vue.js and Tailwind CSS, dependent to day.js.
Documentation
For full documentation, visit litepie.com.
Simple Usage
How it works,
<template>
<div>
<litepie-datepicker
ref="myRef"
:formatter="formatter"
v-model="dateValue"
/>
</div>
</template>
<script>
import { ref } from 'vue';
import LitepieDatepicker from 'litepie-datepicker';
export default {
components: {
LitepieDatepicker
},
setup() {
const myRef = ref(null);
const dateValue = ref([]);
const formatter = ref({
date: 'DD MMM YYYY',
month: 'MMM'
});
return {
myRef,
dateValue,
formatter
};
}
};
</script>
Theming options
Changelog
All notable changes to this project will be documented in this file, Read.
License
The MIT License. Please see for more information.
Thanks to
- Vue
- Tailwind CSS
- day.js
- and other support...
Tailwind 3 support
Hi,
Thanks for the great package,
It there a plan to support Tailwind 3 as i get this error while installing:
Thanks.
Support Vue v2.x / Nuxt v2.x
I tried to install
litepie-datepicker
in my Nuxt 2.x project which has Vue v2.x under the hood and having some issues. Even though I was able to addlitepie-datepicker
as a plugin - it's throwing errors such as:This is my Nuxt.js plugin file:
tailwind is `base` utility is creating conflicts in existing project.
As litepie-datepicker is rely on tailwind, after successful integration of tailwind, it's conflicting with existing CSS that causes lots of design issues.
How can I integrate litepie without affecting existing design?
Trigger don't work in tailwind modal
Hi, i have a strange situation. Datepicker works ok in a custom page, but when i try to show in a modal, trigger doesn't work and datepicker doesn't show.
As you can see, display:none is the status of the class, even when i focused or used custom trigger.
I tried without a modal and it's work ok...
Thanks in advance.
AutoApply on customShortcuts
On mobile, when using customShortcuts, it's impossible to apply changes when autoApply is set to false.
It could be great to set dates directly and submitting it.
Here is the code of my shortcuts, maybe I missed something :
Datepicker alignment
Hi,
Thank you for your work !
As you can see below, the right calendar isn't available, because it's the end of my screen.
It would be great to be able to define if the div under the label has to be on the left or on right side. Maybe something like this :
To do so, I simply added a
right-0
here<div class="absolute z-50 inset-x-auto top-full sm:mt-2.5 right-0"
and set theright-3
in the.litepie-datepicker::before
class instead of theleft-3
.I have some questions about Tailwind css.
1.Do I need to download all the Tailwind CSS to display this plugin UI properly?
2.Don't you provide a small version of CSS to express the calendar UI?
It is burdensome to use in projects that do not use Tailwind CSS.
Plug-in is so good and I want to use it. Thank you for providing this plug-in.
How can i call my function ?
<litepie-datepicker as-single :formatter="formatter" v-model="values[key]" :placeholder="values[key] != '' && !values[na_key] ? values[key] : 'MM-DD-YYYY' " class="zI-1" readonly="readonly" @change="uncheckNa()" :key="!values[na_key] ? 1 : 0"
Here, If I change date in Datepicker, need to call my js func. I use onChange, but it's not working.
Disabling current date
Hello, and awesome library!
I believe there is a bug with disabling current date. If you use
:disable-date
prop to try and disable today, it doesn't work, the date can still be picked.Example: I set
:disable-date
to disable 22.06.2021 (today), user can still select date.Looking forward to a response!
Shortcuts for single?
We can't we have shortcuts working together with
as-single
? I'd like to use a button, for example "7 days ahead" which selects 7 days from now, on single.Added dayjs customParseFormat plugin in order to correctly parse formatter dates
The CustomParseFormat plugin is required to support custom formats passed by the formatter prop.
Without this plugin the date format DD-MM-YYYY gets parsed as MM-DD-YYYY.
Example: when selecting March 8th and re-opening the datepicker, the selected date will be August 3rd.
Resolves #4
Possibility of change startWeek
These changes allows you to choose the first day of the week using the parameter
start-week
. The parameter accepts values from0
to6
Here an example withstart-week=0
:While here an example with
start-week=1
:Date picker runs vertically down the screen
I am working with nuxt3 and I added the date picker as plugin like so:
My datepicker.vue component looks like this:|
However, after importing the component I get the following result on a local build (npm run dev):
And this when clicking (uses entire screen):
I have tailwind version 3.2.1 and I added
path.resolve(__dirname, './node_modules/litepie-datepicker/**/*.js')
to my tailwind.config.js content.[need help] npm is too late than github, i try use postinstall resolve it but meet some problem
i forked this repository, and modify packages.json by add
postinstall: npm i && npm run build:es
, but it loading...you can try
pnpm add https://github.com/Valar103769/litepie-datepicker.git
Is it possible to show label instead of date range when clicked on label?
I would like to show 'Last 15 days', when a user clicked on that shortcut instead of the date range. When a custom date range is chosen, I would like to show the date range. Is this possible?
Datepicker obscured when display in table whitespace-nowrap and scroll X .