Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Datepicker calendar #608

Merged
merged 23 commits into from
Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b40f5b0
Start of datepicker calendar.
Blackbaud-PatrickOFriel Apr 11, 2017
1e82d36
Get working datepicker calendar
Blackbaud-PatrickOFriel Apr 12, 2017
830820b
Add styles for daypicker
Blackbaud-PatrickOFriel Apr 12, 2017
17f8204
Merge branch 'master' into datepicker-calendar
Blackbaud-PatrickOFriel Apr 12, 2017
5241034
Get minDate and maxDate working
Blackbaud-PatrickOFriel Apr 17, 2017
22d0261
clean up scss for datepicker calendar
Blackbaud-PatrickOFriel Apr 17, 2017
a9273cd
fix lint errors for datepicker calendar
Blackbaud-PatrickOFriel Apr 18, 2017
bfea91a
Merge branch 'master' into datepicker-calendar
Blackbaud-PatrickOFriel Apr 18, 2017
bfc2bee
clean up code
Blackbaud-PatrickOFriel Apr 18, 2017
1ee78c0
fix month picker reference
Blackbaud-PatrickOFriel Apr 18, 2017
06594c2
test stubs for datepicker calendar
Blackbaud-PatrickOFriel Apr 18, 2017
f2a19e3
Add initial tests for daypicker
Blackbaud-PatrickOFriel Apr 19, 2017
16652db
Add more tests for datepicker calendar
Blackbaud-PatrickOFriel Apr 19, 2017
eb24bf9
Merge branch 'master' into datepicker-calendar
Blackbaud-PatrickOFriel Apr 19, 2017
cb3a0c2
finish unit tests for datepicker calendar
Blackbaud-PatrickOFriel Apr 19, 2017
1664442
remove inline styles in templates
Blackbaud-PatrickOFriel Apr 19, 2017
31c91e6
Added keyboard support for datepicker calendar
Blackbaud-PatrickOFriel Apr 19, 2017
4c9e4c5
Add unit tests for accessibility
Blackbaud-PatrickOFriel Apr 20, 2017
838dcb9
Update documentation for datepicker calendar
Blackbaud-PatrickOFriel Apr 20, 2017
56e5c89
Add visual tests for datepicker calendar
Blackbaud-PatrickOFriel Apr 20, 2017
d2782e6
fix datepicker test failure
Blackbaud-PatrickOFriel Apr 20, 2017
3b238c3
Merge branch 'master' into datepicker-calendar
Blackbaud-PatrickOFriel Apr 26, 2017
904b316
update builder version and border styles for hover/active state
Blackbaud-PatrickOFriel Apr 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/app/components/datepicker/datepicker-demo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

<div style="display: inline-block">
<sky-datepicker-calendar
[minDate]="minDate"
[maxDate]="maxDate"
[selectedDate]="selectedDate"
(selectedDateChange)="selectedDate = $event"
[startingDay]="startingDay">
</sky-datepicker-calendar>
</div>
<div>
Selected date is {{selectedDate}}
</div>
16 changes: 16 additions & 0 deletions src/app/components/datepicker/datepicker-demo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component } from '@angular/core';

@Component({
selector: 'sky-datepicker-demo',
templateUrl: './datepicker-demo.component.html'
})
export class SkyDatepickerDemoComponent {

public minDate: Date;

public maxDate: Date;

public selectedDate: Date = new Date('4/4/2017');

public startingDay: number = 0;
}
44 changes: 44 additions & 0 deletions src/app/components/datepicker/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<sky-demo-page title="Datepicker">
<sky-demo-page-summary>
The datepicker module contains directives for selecting dates.
</sky-demo-page-summary>

<sky-demo-page-properties sectionHeading="Datepicker calendar properties">
<sky-demo-page-property
propertyName="selectedDate"
isOptional="true"
>
Specifies the selected date in the calendar, when not specified it is set to `new Date()`.
</sky-demo-page-property>
<sky-demo-page-property
propertyName="minDate"
isOptional="true"
>
Specifies a minimum selectable date in the calendar.
</sky-demo-page-property>
<sky-demo-page-property
propertyName="maxDate"
isOptional="true">
Specifies a maximum selectable date in the calendar.
</sky-demo-page-property>
<sky-demo-page-property
propertyName="startingDay"
isOptional="true"
defaultValue="0">
Specifies the starting day of the week in the calendar, where 0 sets the starting day to Sunday.
</sky-demo-page-property>
</sky-demo-page-properties>
<sky-demo-page-properties sectionHeading="Datepicker calendar events">
<sky-demo-page-property
propertyName="selectedDateChange">
When a user selects a new date using the calendar, this event emits the selected date object.
</sky-demo-page-property>
</sky-demo-page-properties>


<sky-demo-page-example>
<sky-datepicker-demo></sky-datepicker-demo>
<sky-demo-page-code demoName="Datepicker"></sky-demo-page-code>
</sky-demo-page-example>

</sky-demo-page>
1 change: 1 addition & 0 deletions src/app/components/demo-components.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ <h1>Components</h1>
*ngFor="let component of components"
[url]="component.url"
[componentName]="component.name"
[hidden]="component.name === 'Datepicker'"
[icon]="component.icon"
>
{{ component.summary }}
Expand Down
21 changes: 21 additions & 0 deletions src/app/components/demo-components.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,27 @@ export class SkyDemoComponentsService {
];
}
},
{
name: 'Datepicker',
icon: 'calendar',
// tslint:disable-next-line
summary: `The datepicker module contains directives for selecting dates.`,
url: '/components/datepicker',
getCodeFiles: function () {
return [
{
name: 'datepicker-demo.component.html',
fileContents: require('!!raw!./datepicker/datepicker-demo.component.html')
},
{
name: 'datepicker-demo.component.ts',
fileContents: require('!!raw!./datepicker/datepicker-demo.component.ts'),
componentName: 'SkyDatepickerDemoComponent',
bootstrapSelector: 'sky-datepicker-demo'
}
];
}
},
{
name: 'Definition list',
icon: 'list-alt',
Expand Down
5 changes: 4 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { SkyCardModule } from './modules/card';
import { SkyCheckboxModule } from './modules/checkbox';
import { SkyChevronModule } from './modules/chevron';
import { SkyColumnSelectorModule } from './modules/column-selector';
import { SkyDatepickerModule } from './modules/datepicker';
import { SkyDefinitionListModule } from './modules/definition-list';
import { SkyDropdownModule } from './modules/dropdown';
import { SkyErrorModule } from './modules/error';
Expand Down Expand Up @@ -80,7 +81,8 @@ import { SkyWaitModule } from './modules/wait';
SkyTextExpandRepeaterModule,
SkyTilesModule,
SkyToolbarModule,
SkyWaitModule
SkyWaitModule,
SkyDatepickerModule
]
})
export class SkyModule { }
Expand All @@ -91,6 +93,7 @@ export * from './modules/action-button';
export * from './modules/card';
export * from './modules/checkbox';
export * from './modules/column-selector';
export * from './modules/datepicker';
export * from './modules/definition-list';
export * from './modules/dropdown';
export * from './modules/error';
Expand Down
7 changes: 7 additions & 0 deletions src/modules/datepicker/date-formatter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let moment = require('moment');

export class SkyDateFormatter {
public format(date: Date, format: string): string {
return moment(date.getTime()).format(format);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div
*ngIf="datepickerMode"
class="sky-datepicker-calendar-inner"
(keydown)="onKeydown($event)">
<ng-content></ng-content>
</div>
33 changes: 33 additions & 0 deletions src/modules/datepicker/datepicker-calendar-inner.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@import "../../scss/mixins";

.sky-datepicker-calendar-inner {
border-radius: 5px;
background-color: $sky-color-white;
@include sky-border(light, top, bottom, left, right);

/deep/ .sky-btn-default {
border-color: $sky-color-white;
}

/deep/ .sky-datepicker-center {
text-align: center;
}

/deep/ .sky-datepicker-btn-selected {
color: $sky-color-white;
background-color: $sky-color-blue;
@include sky-border(dark, top, bottom, left, right);
}

/deep/ .sky-datepicker-secondary {
color: $sky-color-gray-light;
}

/deep/ .sky-datepicker-btn-date {
min-width: 100%;
}

/deep/ .sky-datepicker-calendar-title {
width: 100%;
}
}
Loading