Giter Site home page Giter Site logo

svelte-plugins / datepicker Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 6.0 1.08 MB

A simple datepicker component designed for Svelte.

Home Page: https://svelte-plugins.github.io/datepicker

License: MIT License

Shell 0.24% JavaScript 60.41% Svelte 39.35%
component datepicker dates datetime javascript range-picker rangepicker svelte timepicker

datepicker's People

Contributors

dysfunc avatar marcossaore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

datepicker's Issues

🐛 Keyboard entry of time causes calendar to go to December 1969.

Describe the bug
When using the time picker feature, if you use the keyboard to manually type values it breaks the calendar and jumps to 1969.

To Reproduce
Steps to reproduce the behavior:

  1. Go to example REPL in docs
  2. Add the time picker feature
  3. Manually type a time, ex: (03:30 PM)
  4. Calendar jumps even on example REPL

Expected behavior
To just enter time and for the calendar to not jump dates.

Screenshots
Screenshot 2024-03-05 at 7 45 37 AM

🐛 Cannot set multi-year range

Describe the bug
Hi!
I am trying to set a maximum allowed date in the range picker (a week into the future).
There doesn't seem to be a min/max prop I could use, but I found enabledDates . This doesn't seem to allow multi-year ranges - is this a bug?
The disabledDates also seemed like a good option, but I couldn't find a way to only set the start date (and let it go on forever).

Is there another way to achieve this?

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/vitejs-vite-mfpcpk?file=src%2FApp.svelte
  2. View the example dates

Expected behavior

  • Have a maximum/minimum date as prop or
  • Allow multi-year enabled dates

Screenshots

image

Desktop (please complete the following information):

  • OS: Linux
  • Browser Chrome
  • Version "^1.0.6"

Additional context
Add any other context about the problem here.

Document is not defined -> SSR

I'm experiencing a bug where a lot of the times on refresh my localhost crashes with the error 'document is not defined'. It stems from this line in the datepicker.svelte component:

$: theme !== null && document.documentElement.setAttribute('data-picker-theme', theme);

Thanks for checking it out :)

Using themes

Hello!

I cant get themes to work as they should. I change the theme-attribute in datepicker, but it doesnt use the new tags. I guess im doing it wrong. Would it be possible to add an example how to use themes?

Thanks for your work!

Regards
Joel

Enable dates ✨

Thanks for a great plugin!

Would it be possible to add a inverted function to disable dates? So that instead all dates that are not in an enable-array are disabled?

Regards
Joel

Unable to change the styling of the time picker popup🐛

Describe the bug
I am unable to change the style of the Time Picker popup. It has a white background with blue buttons, but I can't inspect or debug it because it disappears automatically.

To Reproduce
Steps to reproduce the behavior:

  1. Enable showTimePicker param
  2. Click on the time icon
  3. A selector for time will appear
  4. There is no way of changing the color

Expected behavior
A css variable could be exposed to change the styles

Screenshots

Desktop:

  • OS: OSX 14.4
  • Browser Arc
  • Version 1.34.0 (47465)
    Chromium Engine Version 122.0.6261.129

--datepicker-container-border won't work

	:global(.datepicker[data-picker-theme='custom-datepicker']) {
		--datepicker-container-position: relative;
		/* --datepicker-container-width: max-width; */
		--datepicker-calendar-width: 375px;

		--datepicker-state-active: white;
		--datepicker-calendar-header-text-color: #black;
		--datepicker-calendar-day-color: #white;
		--datepicker-calendar-range-selected-background: #111;

		--datepicker-border-color: #111;

		--datepicker-container-border: 100px solid #111;
	}

image

Preset pane for regular DatePicker✨

Very nice plugin :)

It could be a good idea to allow for the sidepane to be opened with the regular Datepicker and have a default 'today' button. In some cases this could save a lot of clicks. If the sidepane is overkill, maybe just as addition next to, or below the month ?

In any case, thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.