Git Product home page Git Product logo

easepick's Introduction

easepick's People

Contributors

arwinvdv avatar dependabot[bot] avatar nuernbergera avatar wakirin avatar

Stargazers

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

Watchers

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

easepick's Issues

Featured requests - Adding new option to allow time picker instead of date

Hi guys,

First of all thanks for your great work, this is awesome package πŸ’― πŸ’― . I think it would be great if you add a feature that allows you to select only the time picker instead of the date, it will help a lot of people ( including me of course πŸ™).

Looking forward to your response .

Thanks & Regards,
Duy.

Date range arrows dont' adapt to day height change

Describe the bug
When using range plugin and changing day cell height, the date range pseudo arrows don't adjust it's top position.

Screen Shot 2022-04-01 at 11 24 39

To Reproduce
Steps to reproduce the behavior:

  1. Turn on RangePlugin
  2. Pass this style variable (along with core styles): --day-height: 25px;
  3. Open date picker and select some range
  4. See range arrows misaligned (not in center vertically)

Expected behavior
Range arrows should center align itself dynamically even if cell height is changed.

Additional context
When completely removing the top parameter from pseudo element arrows it seems to adjust just fine. Is this parameter even necessary?

.container.range-plugin .calendar>.days-grid>.day.start:after {
    border: 8px solid transparent;
    border-left: 8px solid var(--primary-color);
    content: "";
    pointer-events: none;
    position: absolute;
    right: -14px;
    /* top: 11px; <-- disabled this style */
    z-index: 1;
}

Inflection of the month name, polish lang, ISO standard

Describe the bug
In the polish language, months' names should be in another inflection if we use it with days. For eg. '13 lipca', not '13 lipiec' like the plugin provides.

Date class toLocaleString method handles that properly if we use option dateStyle set to long. The plugin composes full date string using day, month and year separately. Month name generated by toLocaleString but with option month set to long in longMonths method of DateTime module does not fit to be month part in full date with day.

Code example
new Date(2022, 06).toLocaleString('pl-PL', {dateStyle: 'long'})
result: '1 lipca 2022'

new Date(2022, 06).toLocaleString('pl-PL', {month: 'long'})
result: lipiec

Support For Vue 3?

Hi. i have two question
-easepick support for vue.js 3 ?

  • For now i use Litepicker. Is that possible? I wanna change text in year dropdown to Buddhist Era. but value is still Christian Era.
    #Example I selcet this year in dropdown it will show 2565 but value is still 2022 ( in select option value is 2022 but Text is 2565 )
    because In Thailand use Buddhist Era.
    If is that possible how to make it. I use this in Vue.js 3 i wanna know how to use it?
    Use in Litepicker version 2.0.11

can't initialize a picker, clone is not a function

Describe the bug
I'm trying to use the library in a stenciljs project, I installed the bundle of npm but when I create a new instance this throw an error

To Reproduce
Steps to reproduce the behavior:
image
image

Aditional context: Im also working this on storybook

Problem with DateTime

Describe the bug
I have found that the DateTime module does not return today's date with toISOString().
I also notice that it does not get the hours and minutes.

To Reproduce

Expected behavior

Code Playground

<!DOCTYPE html>
  <html>
    <head>
      <script src="https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.umd.min.js"></script>
  </head>
    <body>
      <script>
         const DateTime = easepick.DateTime;
         const today01 = new DateTime();
	 const today02 = new Date()
	
         console.log(today01.toISOString())            // "2022-08-07T22:00:00.000Z" ❌
         console.log(today01.toJSDate().toISOString()) // "2022-08-07T22:00:00.000Z" ❌
         console.log(today01.format("YYYY-MM-DD HH:mm:ssZ"))     // "2022-08-08 00:00:00Z" βœ”
         console.log(today02.toISOString())            // "2022-08-08T12:42:41.505Z" βœ”
      </script>
    </body>
  </html>

jsfidle

Picker opens off-screen instead of being positioned above the input

Describe the bug
When the input is positioned close to the bottom of the screen, the picker opens off-screen.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://easepick.com/examples/basic.html
  2. Add height: 700px; to any element above the input to force it down the page
  3. Scroll down so that the input is next to the bottom of the window
  4. Open the picker

2022-06-30 16-20-53 2022-06-30 16_44_32

Expected behavior
The picker should be positioned above the input if there is not enough room below.

Additional context
This issue was referenced in #30 and looks to have been fixed in 1.1.4 but the problem still occurs.

@easepick/kbd-plugin: Focus is trapped, unable to move to the next focusable element

Describe the bug
The focus is trapped into the datepicker input box.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://easepick.com/configurator (do not forget to enable KBD plugin)
  2. Click Configurator heading to set the focus on it
  3. Press tab to focus the Input next
  4. Press tab again to focus the calendar icon and hit enter/space to open the calendar
  5. Choose any date using tab or up/down arrow keys and hit enter to pick a date
  6. The date will set into the input box but can not focus out of it even after pressing Tab incessantly.

Expected behavior
Once the date is picked, the focus should go to the next focusable element or should pass through ahead naturally.

Code Playground
https://easepick.com/configurator

Disabled "This Month" bug

Describe the bug
When use lock-plugin (with max date = today) + preset-plugin button "this month" is disabled.

Expected behavior
If there is a limit (max date) - button "this month" must select from 1st day of this month to max date (today)

Screenshot
image

no auto populate, plus Range/Time plugins, startDate: endDate: do not function as documented, generate 62 clone complaints in console

Describe the bug

Couple of issues here, found at the same time.

  1. "startDate" and and "endDate" RangePlugin options do not seem to have the same flexibility as "setStartDate" and "setStartTime", and I was unable to get them to work because it complains that ".clone" is not a valid method, even if I put new Date(...) instead of string, or a numeric timestamp generated with Math.floor(new Date().getTime()/1000)

  2. RangePlugin does not accept value for time (hours/minutes/seconds/millis) when provided via the methods setStartDate and setStartTime, making it impossible to set a default for the TimePlugin

  3. TimePlugin has no way to set starting values, so if I wanted the default to be 0:0:00 (midnight) to 23:59:59 no way to do this.

  4. Using format: option with H:m:s made the resulting input time string all screwy, as the TimePlugin just sticks its time value right before the date no matter what.

  5. You can't stick a value inside the input tag and have it automatically populate the range and time values when the picker is created.

  6. Usability with auto-apply and TimePlugin: When picking a date that is the same date for the range, it closes the window before you can select the time. Ie "March 21 2022 - March 21 2022" ... There is no way to create a "close button" so you have no way not to "auto apply" your changes except using "Apply" "Cancel". and other is no easy way to change the text of these buttons, ie "Check" "X"

  7. I need a way to set the divider / seperator. Other datepickers use ~ .. it would be nice to change it from '-' to '~'

To Reproduce

	 this.created_picker = new easepick.create({
        element: document.getElementById('manager-search-date-created'),
		plugins: ['RangePlugin', 'TimePlugin'],
        RangePlugin: {
          tooltipNumber(num) {
            return num - 1;
          },
          locale: {
            one: 'day',
            other: 'days',
          },
          startDate: new Date(),
          endDate: 'March 23, 1:35pm'
        },
		TimePlugin: {
			seconds: true,
			append: 'start',
			stepMinutes: 1,
			stepSeconds: 1
		},
        css: [
          'app/js/lib/easepick/easepick.css',
        ],
      });

Expected behavior

  1. There was no way I could use these options. I was forced to use methods setStartDate and setEndDate

  2. I had created specific strings and used new Date(...) but it didn't take into account the time values, even though the time plugin was activated.

  3. I need a way to set the start Hour/ Minute/Second on the "End time"

  4. This needs some refactoring. I cannot figure out how to get the date/time format to change when using the TimePlugin. Setting the "format:" option to "MMMM DD YYYYY HH:mm:ss" for example (matching a default Javascript date format) caused it to display as 0:00 March 22 2022 0:00:00 - 0:07 March 22 2022 07:55:22

  5. This seemed like a no-brainer, but I was surprised it didn't work. I tried generating the string but it didn't just work magically, so I've had to dig into these other features. It would have been easiest if I could have just provided it with a value and had it populate. Normally when you are dealing with a date picker, you have some way of accurately setting the date, and its usually just by a string -- because you've retrieved that data from a database, most likely

  6. & 7) Very confusing. Not enough features to customize the text or buttons.

I picked this plugin over "daterangepicker" and "tempus-dominus" because it displayed correctly out of the box in a WinBoxjs (https://github.com/h3rb/winbox) window. I'd love it if it had some more features that made using it easier/possible. As it stands now the functionality for picking date ranges with time is a bit crippled.

Addendum

Using moment.js, you can generate the values I was testing with this way:

	 var defaultDateTime = '00:00 '+now.getFullYear()+'-'+(now.getMonth()+1)+'-'+now.getDate()+' - 23:59 '+now.getFullYear()+'-'+(now.getMonth()+1)+'-'+now.getDate();
	 var startTime = moment(0,"HH").format('MMMM D, YYYY H:mm:ss');
	 var endTime = moment().add(1,"days").format('MMMM D, YYYY H:mm:ss'); // not supported by easepick :( moment({hour: 23, minute: 59, seconds: 59}).endOf('data').format('MMMM D, YYYY H:mm:ss');

webpack plugin detection bug

I'm using webpack to generate my stuff. When using the DateRangePicker I get the following error: "LockPlugin: options minDays, maxDays, selectForward, selectBackward required RangePlugin."

The error comes from LockPlugin

When using webpack, this.picker.options.plugins is not an array of strings.

import { create, AmpPlugin, RangePlugin, LockPlugin } from '@easepick/bundle';

const rangepicker = create({
    element: '#picker',
    css: [
        'https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css',
        'https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css',
        'https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css',
        'https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css',
    ],
    AmpPlugin: {
        darkMode: false
    },
    RangePlugin: {
        startDate: new Date('2022-08-19'),
        endDate: new Date('2022-09-19'),
    }, 
    LockPlugin: {
        minDate: "2022-07-21T00:00:00.000Z",
        minDays: 3,
        maxDays: 999
    },
    plugins: [AmpPlugin, RangePlugin, LockPlugin],
})

TimePlugin doesn't interact well with RangePlugin repick: true

Enabling TimePlugin as well RangePlugin with repick: true steals focus while trying to select a time. This is true for the custom mode of TimePlugin as well as with native: true in browsers that support a more interactive native time input element.

Show "offset" days

Hi!

How can I show "offset" days like every calendar?

kΓ©p

Thank you for help!

TimePlugin: when a time is selected, apply buttons stays disabled

Describe the bug
When a time is changed, the apply button stays disabled.

To Reproduce

<html>
	<head>
		<meta charset="utf-8" />
		<title>easepick</title>
		<script src="https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.umd.min.js"></script>
	</head>
	<body>
		<input id="datepicker" />
		<script>
			const picker = new easepick.create({
				element: document.getElementById('datepicker'),
				css: [
					'https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css',
				],
				autoApply: false,
				plugins: ['TimePlugin'],
				TimePlugin: {
					format: 'HH:mm',
				},
			});

			picker.setDate('2022-01-01');
			picker.setTime('15:00');
		</script>
	</body>
</html>

Change time in a browser to 16:00. You will see that the apply button is still disabled.

Expected behavior
Not a disabled apply button after a valid change

Broken w/r/t to keyboard navigation

Describe the bug
When I try to use the demo datepicker in the documentation site with a keyboard, I can tab to the "previous month" and "next month" links but I cannot perform any other tasks. In particular, I cannot actually select dates.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://easepick.com/
  2. Press the tab key several times
  3. Note that you can't 'reach' the main datepicker area.

Expected behavior
I expect to be able to tab into the datepicker as a whole and select dates with the keyboard.

Code Playground
n/a

Additional context
This is a showstopper issue for accessibility compliance.

Why support from Safari 14.1?

Hi,

Can you explain why this package is only supported in Safari 14.1 and above?
Does it not work on older versions, or is it flex-gap or some css element that's missed in older versions?

Thanks for your great work!

Is this project still maintained?

Hi πŸ‘‹

I'm currently using this plugin in one of my projects as I really like the UI and general theme. I'm using a combination of plugins, in particular the Range and Time plugin, both of which have several issues floating around on Github with little to no support.

In addition, the last active change on this project was many months ago.

Is this project still being maintained?

The first time the date picker is open it is misplaced.

Describe the bug
The first time the date picker is open it is misplaced, after the first time it is positioned correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://easepick.com/configurator
  2. Click on the date picker input
  3. The date picker shows in the the center of the input.
  4. Close the date picker.
  5. Click on the date picker input.
  6. Now the date picker is in another position.

Expected behavior
The date picker should show in a consistent position.

Code Playground
https://easepick.com/configurator

Event is triggered one page click

Describe the bug
This may or may not be a bug, but it'd be great to understand a workaround. I've got a unique use-case, where I need dates highlighted depending on a status returned from an API.

using the picker.on("view") event, I'm looping through all of the present dates, making the necessary API call and applying a css class to add a background colour to said date depending on said status.
image

However, if I click anywhere within the page, the picker.on("view") event is triggered again. Is this intentional? The API requests need to be made on first load and on month change.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a picker
  2. initialise the picker.on("view") event and do a console.log
  3. Click anywhere outside of the calendar, in the page, the console.log will be triggered again

Expected behavior
The view event makes it sound like it's triggered when the calendar is viewed

Code Playground

Additional context
As I mentioned before, it may or may not be a bug, or I may be trying to apply the use-case incorrectly, but it'd be great if anyone could point me in the right direction.

Selfhosting?

I'm having a hard time figuring out how to host this myself. I've downloaded the assets and load them accordingly (css in the head and js in the body end), but I cant seem to get rid of having to pass css through the initialization step ... how do I do that?

How do I load assets in a normal way without having to load css through the init step – it seems like an odd decision architecture wise.

Angular 13 - Must call super constructor in derived class before accessing 'this'

Describe the bug

I have an issue in Angular 13 with optimization: true. If I set optimization: false, it's working. but... I don't know what happen because I'm calling library as it says in the documentation with budle

import {  easepick } from '@easepick/bundle'

...

this.datePicker = new easepick.create(datePickConfig) 

Error:

image

In this part of the constructor

 const C = class extends Date {
            constructor(i=null, e="YYYY-MM-DD", n="en-US") {
                v(this, "lang"),
                super(C.parseDateTime(i, e, n)),
                this.lang = n
            }
            static parseDateTime(i, e="YYYY-MM-DD", n="en-US") {
                if (!i)
                    return new Date((new Date).setHours(0, 0, 0, 0));
                if (i instanceof C)
                    return i.toJSDate();
                if (i instanceof Date)
                    return i;
                if (/^-?\d{10,}$/.test(String(i)))
                    return new Date(Number(i));
                if ("string" == typeof i) {
                    const r = [];
                    let c = null;
                    for (; null != (c = C.regex.exec(e)); )
                        "\\" !== c[1] && r.push(c);
                    if (r.length) {
                        const l = {

My angular.json

 "configurations": {
            "local": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": {
                "hidden": true,
                "scripts": true,
                "styles": true
              },
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true
            },

KbdPlugin: Issue with tab Index when calendar is hidden

Describe the bug
When using the KbdPlugin, and the calendar is hidden, the days continue taking up tab stops. So if the initiating element is part of a larger form, trying to tab to the next input gets quite cumbersome.

To Reproduce
Steps to reproduce the behavior:

  1. Create an instance of easepick with KbdPlugin enabled
  2. Add it on a page with more input elements
  3. Use the keyboard to choose a date
  4. Try to tab to the next input field

Expected behavior
When the calendar is hidden it should set tabIndex to -1 for all calendar units so that it will not interfere with the tab order on the rest of the page.

Code Playground
Demo: https://d1ruuc.csb.app
Code: https://codesandbox.io/s/magical-snyder-d1ruuc?file=/index.html

Additional context
I fixed this in my own implementation by handling the view event and updating the tabIndex, but I figured maybe you want to include this functionality in the library itself. Please let me know if I'm just not using it the right way!

My fix:

picker = new easepick.create({

  element: document.getElementById("datepicker"),
  css: ["https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css"],

  plugins: [KbdPlugin],

  setup(picker) {
    picker.on("view", (e: CustomEvent) => {
      const { view, target } = e.detail;

      if (target && "querySelector" in target) {
        if (
          view === "CalendarDay" &&
          !["locked", "not-available"].some((x) => target.classList.contains(x))
        ) {

          // ==> Set tabIndex based on picker.isShown()
          target.tabIndex = picker.isShown() ? 2 : -1;

        } else {
          const elems = target.querySelectorAll(".unit:not(.day)");

          // ==> Set tabIndex based on picker.isShown()
          [...elems].forEach(
            (el: HTMLElement) => (el.tabIndex = picker.isShown() ? 1 : -1)
          );

        }
      }
    });
  },
});

Angular v12 throwing Must call super constructor in derived class before accessing 'this' or returning from derived constructor error

Describe the bug
In Angular v12+, it's throwing Must call super constructor in derived class before accessing 'this' or returning from derived constructor error.

new easepick.create({
      element: this.document.getElementById('foo') as HTMLInputElement,
      css: [
        'https://cdn.jsdelivr.net/npm/@easepick/core/dist/index.css',
        'https://cdn.jsdelivr.net/npm/@easepick/range-plugin/dist/index.css',
      ],
})

To Reproduce
Steps to reproduce the behavior:

  1. Generate Angular v12 application and run it on Prod mode i.e. optimization: true in angular.json
  2. Add an input tag in app.component.html with an id foo
  3. Call the above easepick.create method in the constructor of the component class
  4. You will see the error.

Expected behavior
Turns out, in the source code, this ; (separating the super method and this.lang assignment) turns into , at build times.

Code Playground
N/A.

Additional context
Angular v12

When easepick is opened a second time, view starts on today instead of the date filled in

Describe the bug
When someone clicks on the datefield, easepick starts on the date that's filled in. When clicked outside easepick so its closes and clicked on the input again the view renders on today

To Reproduce
Steps to reproduce the behavior:

  1. Click on the datefield, its starts on 2022-01-01
  2. Click outside the datepicker
  3. Click on the datefield again
  4. Datepicker is started at the date of today

Expected behavior
On step 3 i would expect it starts at 2022-01-01 because thats the value

Code Playground

<html>
	<head>
		<meta charset="utf-8" />
		<title>easepick</title>
		<script src="https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.umd.min.js"></script>
	</head>
	<body>
		<input id="datepicker" value="2022-01-01" />
		<script>
			const picker = new easepick.create({
				element: document.getElementById('datepicker'),
				css: [
					'https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.css',
				],
				autoApply: false,
			});
		</script>
	</body>
</html>

When I click Next Month button, one month get skipped, easepick jumped over one month

Today is 30th on Jan. I am on easepick.com using Mobile view (iPhone 12)
When I click 'next month' I get March (should be February).
This behavior doesn't happen on desktop view (Maybe because I see two calendars instead of one?)

I did many clicks and jumping over one month seems to have some random behavior. Couldn't notice notice any repetition.
If you click back and next - it doesn't jump over one month anymore. E.g. Jan > Mar < Feb < Jan > Feb

Tested in Chrome and FF
Can somebody confirm this?

AMP-plugin dropdown configures wrong calendar for multiple calendars

Describe the bug
When showing multiple calendars, the AMP-plugin dropdown always configures the first calendar instead of the calendar you are editing.

To Reproduce

  1. Go to https://easepick.com/configurator
  2. Set the amount of calendars to 2 or higher
  3. Enable the AMP plugin
  4. Enable the month dropdown
  5. Open the easepick widget
  6. Select 'May' in the second calendar

Expected behavior
I expect the first calendar to show the month of April, and the second calendar to show the month of May.

Actual behavior
The first calendar now shows the month of May and the second calendar shows June.

Code Playground
https://jsfiddle.net/txs5bc36/

feat: show start/end of locked range as "half locked"

Ugh.. horrible title. Sorry about that, let me explain.

The calendar shows disabled days as this:

image

Is there any way to have the start of a locked range look like "half locked," sort of how this is:

image

See how the beginning and end of a locked range is slanted? Maybe have lockedStart, locked, and lockedEnd css classes?

If you can get this done by tomorrow, I'll give you $100USD (paypal / venmo).
You have no idea how bad I need this lol My deadline is tomorrow

I have fallen in love with easypick! It's EXACTLY what I need! Thank you (x100) for creating this!

CSS via node_modules or local folder

Hi,

I am trying to use the easepick into my component using VUE3, but when change de css (param) to de autoimport, doesn't work for me, always need an external css url into config?

It's possible?

image

image

image

Custom Preset plugin

Discussed in #61

Originally posted by pallardino May 14, 2022
An other question for customising preset-plugin.

  • First, I have tried to customise labels to put it in French. According to the documentation I passed a list of string, but unfortunately I got the following error from my js console :
    TypeError: this.options.customLabels.forEach is not a function. (In 'this.options.customLabels.forEach(((t,e)=>{this.options.customPreset[t]=s[e]}))', 'this.options.customLabels.forEach' is undefined)
  • Second, I don't really understand how I can define your own ranges. According to the documentation I have to pass an object, but which object ? For exemple, I would like delete all predefined range and create a custom range for a year.
Capture d’écran 2022-05-13 aΜ€ 10 21 44 PM

Thanks in advance

lock-plugin minDate and maxDate issue

Describe the bug
LockPlugin minDate and maxDate not working with ISO string

To Reproduce
Within configuration:

LockPlugin: {
minDate: '2022-04-01',
maxDate: '2022-09-01',
}

Expected behavior
minDate and maxDate applied as given

Additional context
Current behavior is that today is the upper limit on maxDate and the lowest limit on minDate. When i convert it to a Date object it works as expected:

LockPlugin: {
minDate: new Date('2022-04-01'),
maxDate: new Date('2022-09-01'),
}

Not able to pass empty dates for custom preset or add custom range button option in preset

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Code Playground
Provide a link to code playground like https://jsfiddle.net, https://codepen.io, etc.

Additional context
Add any other context about the problem here.

TimePlugin with native: true should dispatch select event on change

Right now we have to listen the change event ourselves, I think the API would be a lot more obvious if the widget always globally dispatches either select, change or both when any value is changed in any configuration.

Related to that with autoApply: false it also looks like the apply button doesn't get enabled after changing just the time.

On a side note finding an example on how to properly listen to changed values was a bit difficult for me, so making that clearer is probably the biggest documentation improvement to make :)

picker.show() not working correctly

If I understand that correctly, you can specify a target for picker.show() (example: document.querySelector('#date3')) but it doesn't focus on the field but is in the top left corner.

I have:
date start input field (display none)
date end input field (display none)
and date3 input field (custom value) <- click, open and focus picker (currently open in left top corner)

in the meantime i tried to switch the element back and forth but i don't know how to change options

Repick (from range plugin) does not seem to work with inline

Describe the bug
Repick option with range plugin does not work with inline. When inline is on, clicking the end input box does not behave as expected. It behaves as if the user is picking from the beginning. (ie. you have to click twice, choosing the start time again as well)

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://easepick.com/configurator/
  2. Enable range plugin and turn on element end and repick
  3. Enable inline from core
  4. Pick a date, and repick by clicking on the element end and pick a date

Expected behavior
For the end date to be set to the date picked, and the start date remain unchanged

Selecting 1970-01-01 via the datepicker will result in todays date

Describe the bug
Selecting 1970-01-01 via the datepicker will result in todays date.
Also, picking dates from [1970-01-02 - 1970-01-13) will result in invalid dates. Eg. Input 1970-01-12 wil result in date 119308-07-10

To Reproduce
Steps to reproduce the behavior:

  1. Go to easepick.com
  2. Click on the date input field
  3. Select date 1970-01-01 using the date picker
    i. Expected: date 1970-01-01 is selected
    ii. Actual: today's date is selected

Expected behavior
Date 1970-01-01 is selected

Code Playground
This problem can be reproduced on easepick.com

Generic ".container" selector breaking page

Describe the bug
easepick is using the classname "container" without any prefix, which is a very common classname, and it's breaking the site.

To Reproduce
Use it on a site where the container classname conflicts

Month Switch not correct on monthend

Describe the bug
I currently have a problem where I think it will only occur at the end of the month. currently we have the 31.08. if I now want to scroll to the next month, I end up at the x.10. instead of x.9.

To Reproduce

Two window picker inits with disabled future dates

Describe the bug
When having more than 1 calendar window, and set up maxDate to past/present, picker populates with wrong options (future disabled month).

To Reproduce
Steps to reproduce the behavior:

  1. Init picker with following options:
{
   calendars: 2,
   plugins: [LockPlugin],
   LockPlugin: {
      maxDate: new DateTime()
   }
}
  1. Open picker
  2. See unusable second window with options of future (disabled) date

Expected behavior
Picker should initialize with correct (usable) options.

Additional context
I does fix itself when switching to past month - it's not possible to go back to the future.

Screen.Recording.2022-03-31.at.17.55.02.mov

@easepick/preset-plugin: wrong date-start and date-end Attributes

I think the data-start and data-end Attributes (button) is wrong. This contains current date not the preset date.
Moreover, it does not harmonize with the TimePlugin. The times (hour, minute) are only used if "autoApply: true" is (the timePlugin is not updated at the moment)

#97

("Feature request": Nice to have a select class for chosen the preselect.)

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.