Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (breaking change) support for optional date pickers #468

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

gknoy
Copy link
Contributor

@gknoy gknoy commented Sep 13, 2017

This project uses semver, please check the scope of this pr:

  • #none# - documentation fixes and/or test additions
  • #patch# - backwards-compatible bug fix
  • #minor# - adding functionality in a backwards-compatible manner
  • #major# - incompatible API change

Breaking change:

The date renderer no longer defaults to the current date, so that we can present optional fields which do not have a value yet chosen, without mistakenly persisting today's date as a selection.

One can default to the current date by providing defaultToCurrentDate: true in the renderer options of the cell config.

Usage

Default to undefined:

// bunsen-view.js
{
  model: 'foo',
  renderer: {
    name: 'date'
  }
},

Default to the current date:

// bunsen-view.js
{
  model: 'bar',
  renderer: {
    defaultToCurrentDate: true,
    name: 'date'
  }
}

Example (from demo)

screen shot 2017-09-13 at 3 17 56 pm

Changelog

  • Date widget no longer defaults to current date. Specifying defaultToCurrentDate: true in the renderer options will re-enable this behavior.
  • Use ember-frost-date-picker@7.3.0
  • Add two different date renderers to demo

 #MAJOR#

The `date` renderer no longer defaults to the current date, so that we
can present optional fields which do not have a value yet chosen,
without mistakenly persisting today's date as a selection.

 ### Usage
Default to `undefined`:
```javascript
// bunsen-view.js
{
  model: 'foo',
  renderer: {
    name: 'date'
  }
},
```
Default to the current date:
```javascript
// bunsen-view.js
{
  model: 'bar',
  renderer: {
    defaultToCurrentDate: true,
    name: 'date'
  }
}
```

 # Changelog
- Date widget no longer defaults to current date.  Specifying
  `defaultToCurrentDate: true` in the renderer options will re-enable
  this behavior.
- Use ember-frost-date-picker@7.3.0
- Add two different date renderers to demo
@@ -5,6 +5,10 @@ import layout from 'ember-frost-bunsen/templates/components/frost-bunsen-input-d

const DATE_FORMAT = 'YYYY-MM-DD'

export const deps = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I see you did this to make it stubbable.

@sophypal
Copy link
Contributor

sophypal commented Sep 13, 2017

👍

Approved with PullApprove

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 25271bc on gknoy:gknoy/add-optional-date-default into ** on ciena-frost:master**.

@sophypal sophypal merged commit bd084da into ciena-frost:master Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants