Skip to content

Commit

Permalink
bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
Anisha7 committed Nov 22, 2019
1 parent ed239c5 commit 1f15f0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ class AnDate {

// Takes an offset object with any of the following properties: years, months, days, hours, minutes, seconds, milliseconds
consecutiveDates(repeat, offset) {
// Why doesn't this return the AnDate class object, with all its properties?
const createDate = (date, offset) => {
return new Date(
date.getFullYear() + offset.years,
date.getMonth() + offset.months,
date.getDate() + offset.days,
date.getHours() + offset.hours,
date.getMinutes() + offset.minutes,
date.getSeconds() + offset.seconds,
date.getMilliseconds() + offset.milliseconds
return new AnDate(
date.year() + offset.years,
date.month() + offset.months,
date.day() + offset.days,
date.hours() + offset.hours,
date.minutes() + offset.minutes,
date.seconds() + offset.seconds,
date.milliseconds() + offset.milliseconds
);
};
let offsetObject = {
Expand All @@ -157,7 +158,7 @@ class AnDate {
offsetObject = { ...offsetObject, ...offset };

let result = [];
result.push(this.date);
result.push(this);
for (let i = 1; i < repeat; i += 1) {
result.push(createDate(result[i - 1], offsetObject));
}
Expand Down
2 changes: 1 addition & 1 deletion umd/andatelib.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f15f0f

Please sign in to comment.