Code Monkey home page Code Monkey logo

vaadin-date-range-picker's Introduction

Published on Vaadin Directory Latest version Build Quality Gate Status Vaadin 24+

vaadin-date-range-picker

A Vaadin Flow DateRangePicker implementation

demo

Installation

Installation guide for the latest release

Compatibility with Vaadin

Vaadin version DateRangePicker version
Vaadin 24+ (latest) 4+
Vaadin 23 3.x
Vaadin 14 (LTS - former release model) 2.x

Run the Demo

  • Checkout the repo
  • Run mvn install && mvn -f vaadin-date-range-picker-demo spring-boot:run
  • Open http://localhost:8080
Show example

demo

Support

If you need support as soon as possible and you can't wait for any pull request, feel free to use our support.

Contributing

See the contributing guide for detailed instructions on how to get started with our project.

Dependencies and Licenses

View the license of the current project or the summary including all dependencies

vaadin-date-range-picker's People

Contributors

ab-xdev avatar actions-user avatar dependabot-preview[bot] avatar dependabot[bot] avatar johannesrabauer avatar xdev-renovate 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

Watchers

 avatar  avatar  avatar  avatar

vaadin-date-range-picker's Issues

DateRangePicker.clear() throws NPE

The default implementation of clear in HasValue uses the default getEmptyValue, which is null. I am not sure what should happen if clear is called, but a NPE should never occur. I think it should jump back to the defaultModel.

java.lang.NullPointerException: null
	at software.xdev.vaadin.daterange_picker.ui.DateRangePicker.tryFixInvalidModel(DateRangePicker.java:355) ~[vaadin-date-range-picker-2.0.0.jar:2.0.0]
	at software.xdev.vaadin.daterange_picker.ui.DateRangePicker.updateFromModel(DateRangePicker.java:333) ~[vaadin-date-range-picker-2.0.0.jar:2.0.0]
	at software.xdev.vaadin.daterange_picker.ui.DateRangePicker.setValue(DateRangePicker.java:501) ~[vaadin-date-range-picker-2.0.0.jar:2.0.0]
	at software.xdev.vaadin.daterange_picker.ui.DateRangePicker.setValue(DateRangePicker.java:63) ~[vaadin-date-range-picker-2.0.0.jar:2.0.0]
	at com.vaadin.flow.component.HasValue.clear(HasValue.java:179) ~[flow-server-2.4.2.jar:2.4.2]

DateRange quarter allow future selection over start date

Hey,
Currently, for the SimpleDateRange Quarter, it is not possible to select a start date which is after the current quarter. This can only be done through the end date. I think for usability it should be possible to select the quarter also over the start date.
I don't know if this is limited by the 'calcForFunc' which only uses one date and not both.

Add the option to use other Datepickers / Add Datepicker supplier

Currently the Vaadin Datepicker is very limited.
For example it doesn't support a date format โ†’ vaadin/flow-components#911

However there are some solutions for this problem:

To make them work a supplier (with GeneratedDatePicker) or two - for start and end - is required.

Some typos

Hey,
While working with the component I discovered some typos. I am not sure If there are more of them, but it should be checked:

I18n problems

Hi XDEV,
I have tested today your component. First of all, it's great!

But while developing I discovered some problems with translating the component:

  1. If I apply another dateRangeLocalizerFunction, it is never called. The set of the LabelGenerator is called in initUI of DateRangePickerOverlay, which is called on constructor invocation. So the change afterward doesn't have any effect.
    this.cbDateRange.setItemLabelGenerator(this.dateRangePicker.getDateRangeLocalizerFunction());

It should be applied like the translation for the DatePickers in the AttachEvent.
I could create a pull request for this.

  1. I think there could be a more uniform way to access the labels of the DatePickers and the Combobox. This is only a suggestion. I discovered these while using this component. Some documentation/tutorial could also help here.

I am also from Germany, so we could communicate in german. Feel free to contact me.

Best regards,
Dario

Change method signature for setting the DateRange

Hey,
I was searching for a way to set the default DateRange. With the way, I was thinking, I ended up with getting the current model and setting the DateRange to it. Now I was digging through the code and saw the method which (I think) is meant to be used for this setModellForTodayAndByDateRange. The first time I saw this method, it was curious to me. I would simply name the method 'setDateRange' and maybe overload it with a version to supply the LocalDate by yourself. The explanation should be done with some JavaDoc.

A faster accessor for the current DateRange would be also nice. So you can call it simply at the DateRangePicker to get the current value. In general, it may make sense to pass through the accessor methods of the model. It's just an idea, I am happy to discuss this.

public void setModellForTodayAndByDateRange(final D range)
{
range.calcFor(LocalDate.now())
.ifPresent(result -> this.setModell(new DateRangeModell<>(result.getStart(), result.getEnd(), range)));
}

DRP overlay closes if clicking with opened DatePicker overlay somewhere else

Firstly, thanks for the fixes and updates to the DateRangePicker. I really appreciate it ๐Ÿ‘.

Description

The DRP overlay closes if you are clicking out of the DatePicker overlay back into the DRP overlay or on another component. This does not happen if it is closed with a selection or close action.

GIF

DateTimePicker

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.