Skip to content

Commit

Permalink
Remove daysForMonth from set
Browse files Browse the repository at this point in the history
  • Loading branch information
leshakoss committed Sep 9, 2019
1 parent d0e1194 commit c27bfea
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/set/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export default function set(dirtyDate, dirtyOptions) {

var date = toDate(dirtyDate)

var daysForMonth =
values.date == null ? date.getDate() : toInteger(values.date)

// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if (isNaN(date)) {
return new Date(NaN)
Expand All @@ -73,7 +70,7 @@ export default function set(dirtyDate, dirtyOptions) {
}

if (values.month != null) {
date.setMonth(toInteger(values.month), daysForMonth)
date.setMonth(toInteger(values.month))
}

if (values.date != null) {
Expand Down

0 comments on commit c27bfea

Please sign in to comment.