Skip to content

Commit

Permalink
fix(calendar): Fixing the building of the months
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Godi committed May 4, 2017
1 parent c38e5e4 commit 934d245
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions demo/pages/elements/calendar/CalendarDemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const template = `
<h2>Calendar Picker <small><a target="_blank" href="https://github.com/bullhorn/novo-elements/blob/master/src/elements/date-picker">(source)</a></small></h2>
<p>The calendar picker is used to select a date. It appears in all date picker fields.</p>
<h5>Big Calendar Picker</h5>
<div class="example demo">${BigCalendarDemoTpl}</div>
<code-snippet [code]="BigCalendarDemoTpl"></code-snippet>
<h5>Full Calendar Picker</h5>
<div class="example demo">${CalendarDemoTpl}</div>
<code-snippet [code]="CalendarDemoTpl"></code-snippet>
Expand All @@ -38,6 +34,10 @@ const template = `
<h5>Date Time Picker</h5>
<div class="example demo">${DateTimeDemoTpl}</div>
<code-snippet [code]="DateTimeDemoTpl"></code-snippet>
<h5>Big Calendar Picker</h5>
<div class="example demo">${BigCalendarDemoTpl}</div>
<code-snippet [code]="BigCalendarDemoTpl"></code-snippet>
</div>
`;

Expand Down
10 changes: 3 additions & 7 deletions demo/pages/elements/calendar/templates/CalendarDemo.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<div class="calendar-demo-side-by-side">
<p>
<label>Value One</label>
{{(dateOne | date) || 'N/A'}}

<label>Value Two</label>
{{(dateTwo | date) || 'N/A'}}
<label>Value One</label> {{(dateOne | date) || 'N/A'}}
<label>Value Two</label> {{(dateTwo | date) || 'N/A'}}
</p>
<novo-date-picker [(ngModel)]="dateOne" minYear="2000" maxYear="2020"
[start]="start" [end]="end"></novo-date-picker>
<novo-date-picker [(ngModel)]="dateOne"></novo-date-picker>
<novo-date-picker [(ngModel)]="dateTwo"></novo-date-picker>
</div>
2 changes: 1 addition & 1 deletion src/elements/date-picker/DatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export class NovoDatePickerElement implements ControlValueAccessor, OnInit {
count = 0;

if (date.getDay() !== 0) {
date = dateFns.subDays(date, date.getDate() - date.getDay());
date = dateFns.subDays(date, date.getDay());
}

while (!done) {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/date-time-picker/DateTimePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class NovoDateTimePickerElement implements ControlValueAccessor, OnInit,
count = 0;

if (date.getDay() !== 0) {
date = dateFns.subDays(date, date.getDate() - date.getDay());
date = dateFns.subDays(date, date.getDay());
}

while (!done) {
Expand Down

0 comments on commit 934d245

Please sign in to comment.