Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Calendar #36

Closed
4 tasks done
mAiNiNfEcTiOn opened this issue Mar 13, 2017 · 0 comments
Closed
4 tasks done

Calendar #36

mAiNiNfEcTiOn opened this issue Mar 13, 2017 · 0 comments

Comments

@mAiNiNfEcTiOn
Copy link
Contributor

mAiNiNfEcTiOn commented Mar 13, 2017

The calendar component must meet the following requirements (WIP, and not in the specified order):

  • Must be possible to define minDate and maxDate to define boundaries of selection.
  • Must be possible to define onSelectDay to pass a handler of the selected date.
  • Must be possible to define isDaySelectableFn to pass a function that should return a Boolean value to determine if the day is selectable.
  • Must be possible to define locale, which will receive an object with the following things:
{
  months: [
    { name: 'January', short: 'Jan' },
    { name: 'February', short: 'Feb' },
    // ...
  ],
  startWeekDay: 1, // retrieved via new Date().getDay(), where 0 = Sunday, 6 = Saturday
  weekDays: [
    { name: 'Monday', 'short: Mon' },
  ],
}
@mAiNiNfEcTiOn mAiNiNfEcTiOn created this issue from a note in Components (Backlog) Mar 13, 2017
@mAiNiNfEcTiOn mAiNiNfEcTiOn self-assigned this Mar 13, 2017
@mAiNiNfEcTiOn mAiNiNfEcTiOn moved this from Backlog to In progress in Components Mar 13, 2017
mAiNiNfEcTiOn added a commit that referenced this issue Mar 21, 2017
* Changes the builder to use the util.inspect() to output the error

Adds the Calendar component

Updates the example to show the dates (not final)

Changes the DaysPanel to export directly the class

Makes the code more explicit on the calendar.js

Makes the styles customizable

Fixes the _default.yaml to be able to build

Fixes SCSS to build :D

Changes the builder to actually output (and colorize) when an error happens

Adds classNames to elements to make them more specific

Fixes bug where an error would be triggered when the initialDates attribute was not set. Also resets the minLimit to the passed one when provided via attributes or to null when none is available

Hides the nav button when not enabled

Changes the _default.yaml to have decent colors for the rendering :P

Adds the function leftPad() to the helpers to do left padding of the months and days

Improves the code based on the reviews' feedback. Also makes it more testable and fixes some bugs detected when developing the unit tests

Converts the DaysPanel to a stateless component with no mods (for now)

Improves the code based on reviews' feedback. Also makes it more testable and introduces a new method to merge the locale definitions

Removes the enzyme-to-json package and brings jest-serializdr-enzyme which is then configured in the jest config

Reverts the removal to give time to migrate the other unit tests. Adds the serializer configuration to the jest.config.json

Adds the unit tests and its snapshots

Updates the tests for UTC

Removes the mods and the dataAttrs from the 'defaultProps'.

Updates the snapshots

Attempt to set some colors matching the defined color pattern

Updates the snapshots

Adds some aria-labels to increase accessibility

Adds updated snapshots

Fixes a lint error :P

Adds a function to normalize the dates on the time

Changes the code to use the newly added function

Updates the tests to use the normalizeDate() and updates the snapshots

Moves the 'bind' to its own declaration, to prevent warnings from linting

Changed the 'extraClasses' variable to be named 'mods'

Changes the 'npm test' to set the testing to be always UTC (to solve CI issues)

Also added the TZ=utc to the update-snapshots script

Adds a function processProps() to be used by both the constructor and the componentWillReceiveProps() from the Calendar component

Adds a wrapper component to make the test of the props being changed. Also adds a test to verify the componentWillReceiveProps. Updates the snapshots

Improves coverage of the componentWillReceiveProps

Downgraded eslint-plugin-react due to a bug on the jsx-indent rule: jsx-eslint/eslint-plugin-react#1117

Fixes the issue with the eslint-plugin-react's version, enabling the indentLogicalExpressions

Adds the possibility to override the display text in the navigation buttons, as well as the aria-label attribute

* Adds the examples with a normal calendar with all props set and a range calendar with all props set

* Fixes issue where renderDate was not between the min and max limits, so needed to be readjusted

* Fixes issue where in the edge-months (0 and 11) we were doing improper math :D

* Updates the snapshots and the tests to cover properly with the new changes

* Fixes poor configuration on the .eslintrc

* Improved readability on the ternary operator of the handling of the renderDate
@mAiNiNfEcTiOn mAiNiNfEcTiOn moved this from In progress to Done in Components Mar 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests

1 participant