Giter Site home page Giter Site logo

opuscapita / react-dates Goto Github PK

View Code? Open in Web Editor NEW
47.0 15.0 9.0 22.94 MB

React date(range) inputs/pickers

Home Page: https://opuscapita.github.io/react-dates

License: Apache License 2.0

JavaScript 86.11% CSS 4.95% HTML 0.47% Shell 1.55% Less 6.91%
react javascript dateinput daterange daterangepicker datepicker component cashmanagement

react-dates's Introduction

React Datepicker, DateInput, DateRangeInput

CircleCI Status badge-npm-version badge-license NPM Downloads

date-input

OpusCapita React Components (date inputs/pickers)

This project uses react-day-picker

Implemented components

  • DateInput
  • DateRangeInput
  • DatePicker

Demo and documentation

Online demo and components reference available here: https://opuscapita.github.io/react-dates

Demo powered by react-showroom

Installation

npm install --save @opuscapita/react-dates

Date format

  • dd - day
  • MM - month
  • yy - year

Any separators except these allowed: 1, a, A, *, #

Contributors

Alexey Sergeev
Kirill Volkovich

License

Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

react-dates's People

Contributors

abaliunov-sc avatar amotuz-sc avatar andrevitalb avatar arturszwed-oc avatar asergeev-sc avatar ashestak-sc avatar ddivin-sc avatar dsanko-sc avatar dshienok-sc avatar estambakio-sc avatar kvolkovich-sc avatar mpritchin-sc avatar ocmachineuser avatar visortelle 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

Watchers

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

react-dates's Issues

Draw date input calendar with non-form tag

As we might want to use date input inside <form></form> tag, it is really not a good idea to draw calendar using form, because it can cause problems if embedded forms.

Due to latest change in [email protected], there is some error in react-dates

ERROR in /var/tmp/base/~/@opuscapita/react-dates/lib/DateVariants/DateVariants.react.js
Module not found: Error: Can't resolve '@opuscapita/react-autocompletes/lib/VerticalList' in '/var/tmp/base/node_modules/@opuscapita/react-dates/lib/DateVariants'

react-dates also require an update it seems. Can you please look into this

Add 'onFocus' & 'onBlur' event support

As we need to collaborate with other components we might need some more common react-input api event.
For the first touch lets add 'onFocus' & 'onBlur' as the most used ones.

Datepicker isn't close at pressing Today

In case selection some date on date picker or date range, date populated and it automatically closed
But at pressing 'Today' date populated but datepicket still diasplyed

No other options for locale

This is the best datepicker i've found, but i just can't use it if i can't translate it into my native language...
It would be great to import a json file and send it to a prop in any date picker component so it uses it as a base. something like
{months:["Janeiro", "Fevereiro", ...], week_days:["Domingo", "Segunda", ...]}

cannot open `DateRangeInput`'s popover

here is my code. DateRangeInput's popover not working, but DateInput is ok.

version: beta13

import React from 'react';
import { DateRangeInput } from '@opuscapita/react-dates';

export default class extends React.PureComponent {
  constructor(options) {
    super(options);

    this.state = { value: [] };
    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(value) {
    this.setState({ value });
  }

  render() {
    return (
      <DateRangeInput
        onChange={value => this.setState({ value })}
        value={this.state.value}
      />
    );
  }
}

DateRangePicker shows dropdown with predefined periods sticked to left side

Meta-Info Value
ExtProjectId JCPIM-01.3
Original Estimation 10h
Remaining Estimation 10h

Original issue: https://github.com/OpusCapita/minsk-core-externals/issues/316

How to reproduce

Expected behavior

Dropdown appears under the button you've just clicked, sticked to the right side of input

What actually happens

Dropdown appears on the left side instead.

Add possibility to define disabled days

Meta-Info Value
ExtProjectId JCPROC-01
Original Estimation 10h
Remaining Estimation 10h

Add the same possibilities as it is available in react-day-picker disabledDays. This possibility should be available in the following components:

  • DateInput
  • DateRangeInput

Add 'nb' locale as fallback for 'no' locale

DateInput from react-dates doesn't work under Norsk language ('no' language tag).

TypeError: Cannot read property 'firstDayOfWeek' of null

MomentJS not supported Norsk['no'] language, but are supported 'nb' & 'nn'. We can add this language but not clear what formats and translations should be.

DateInput showToLeft prop is reversed

What's expected: if showToLeft === true the datepicker popup should appear on the left side.

What's actually happening: Popup aligned to right if showToLeft === true and aligned left if showToLeft === false.

DateRangeInput picker extend outside mobile area

Hi there. I've been investigating use of your date pickers and noticed that on mobile screens the dual datepickers for range extend outside the screen. Is there any way to alter this behaviour? Maybe put one under the other or somesuch? I couldn't see any ability to tweak the pickers from DateInputRange.

Thanks

Placeholder color under IE/Edge

Meta-Info Value
ExtProjectId JCPROC-01
Original Estimation 1h
Remaining Estimation 1h

Placeholder color is different for IE/Edge browsers. In firefox its color is #aaa, but in IE it is black. Please, check https://opuscapita.github.io/react-dates//branches/master/index.html?currentComponentName=DateInput under IE/Edge and Firefox/Chrome/etc.

Probably can be fixed by

:-ms-input-placeholder, ::-ms-input-placeholder {
  color: #aaa !important;
}

Procurement ticket: https://support.jcatalog.com/browse/PROC-6832
Original issue: https://github.com/OpusCapita/minsk-core-externals/issues/356

Needless wrappers for inputs lead to excessive horizontal margin

Needless type=text in wrapper div.

<div class="opuscapita_date-range-input form-control">
  <div class="opuscapita_date-range-input__input-field-container form-control">
    <div class="opuscapita_date-input-field form-control opuscapita_date-range-input__input-field opuscapita_date-range-input__left-input-field" type="text">
      <input type="text" value="" placeholder="DD/MM/YYYY" tabindex="0"/>
    </div>
    <div class="opuscapita_date-range-input__dash">―</div>
    <div class="opuscapita_date-input-field form-control opuscapita_date-range-input__input-field opuscapita_date-range-input__right-input-field" type="text">
        <input type="text" value="" placeholder="DD/MM/YYYY" tabindex="0"/>
    </div>
    <div class="opuscapita_input-addon-button opuscapita_date-range-input__reset-btn" tabindex="-1">✕</div>
  </div>
    <button type="button" class="btn btn-default opuscapita_date-range-input__variants-btn" tabindex="-1">
      <span class="caret"></span>
    </button>
</div>

It is impossible to choose 1 day only

Test steps:
1.1 Enter first date in datepicker and try to select the same date for the end of period.
Actusl result: All dates have been removed from datepicker.

Bundle size is too big

Meta-Info Value
ExtProjectId JCPROC-01
Original Estimation ???h
Remaining Estimation ???h

It cause momentjs usage.
We can move it to peerDependencies or replace by something else.

Change property name 'date' to 'value'

To be consistent to react component naming convention that supports onChange and value properties, please change date property name to value.

This is not just a cosmetic change - libraries like redux-form us react-common notation to inject it's own specific props to declared inputs.

DateInput DOM events: onBlur fires before onChange

How to reproduce:

<DateInput value={null} dateFormat="dd/MM/yyyy" onChange={() => console.log('onChange')} onBlur = {() => console.log('onBlur')} disabled={false} showToLeft={false} showToTop={true} />

Check some date and look at browser console log.

Expected behavior: onChange should fire before onBlur.

What's actually happening: onBlur fires first. It breaks a consumer's logic if it depends on idiomatic behavior.

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.