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

testing new build #351

Merged
merged 1 commit into from
Jan 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
782 changes: 716 additions & 66 deletions npm-shrinkwrap.json

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ng2-date-picker",
"author": "Vlad Ioffe",
"version": "2.7.3",
"version": "2.6.2",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand All @@ -12,9 +12,9 @@
"lint": "ng lint",
"e2e": "ng e2e",
"e2e:headless": "ng e2e -- headless",
"build:demo": "rm -rf dist/ && ng build --prod --aot=false --bh /angular-datepicker/ && npm run build:index",
"build:index": "cd build-helpers && node index-maker.js",
"build:prod": "node build.js && ngc && cp package.json bin",
"build:demo": "rm -rf dist/ && ng build --prod --aot=false --bh /angular-datepicker/ && npm run build:index",
"build:prod": "ng-packagr -p package.json",
"release": "npm run build:prod && npm publish bin",
"pack": "cd bin && npm pack",
"postinstall": "opencollective postinstall"
Expand Down Expand Up @@ -65,6 +65,7 @@
"karma-jasmine-html-reporter": "^0.2.2",
"less": "^2.7.2",
"ncp": "^2.0.0",
"ng-packagr": "^1.6.0",
"protractor": "~5.1.0",
"rimraf": "^2.6.1",
"rxjs": "^5.1.0",
Expand All @@ -79,9 +80,13 @@
"skipTemplateCodegen": true,
"strictMetadataEmit": true
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/angular-datepicker",
"logo": "https://opencollective.com/opencollective/logo.txt"
"ngPackage": {
"lib": {
"entryFile": "src/app/index.ts",
"externals": {
"moment": "moment"
}
},
"dest": "bin"
}
}
3 changes: 2 additions & 1 deletion src/app/common/services/utils/utils.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {inject, TestBed} from '@angular/core/testing';
import {UtilsService} from './utils.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {IDate} from '../../models/date.model';
const moment = momentNs;

describe('Service: ObUtilsService', () => {
beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/app/common/services/utils/utils.service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {ECalendarValue} from '../../types/calendar-value-enum';
import {SingleCalendarValue} from '../../types/single-calendar-value';
import {Injectable} from '@angular/core';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment, unitOfTime} from 'moment';
import {CalendarValue} from '../../types/calendar-value';
import {IDate} from '../../models/date.model';
import {CalendarMode} from '../../types/calendar-mode';
import {DateValidator} from '../../types/validator.type';
import {ICalendarInternal} from '../../models/calendar.model';
import {forEach} from '@angular/router/src/utils/collection';
const moment = momentNs;

export interface DateLimits {
minDate?: SingleCalendarValue;
Expand Down
3 changes: 2 additions & 1 deletion src/app/date-picker/date-picker.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {inject, TestBed} from '@angular/core/testing';
import {DatePickerService} from './date-picker.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {DayTimeCalendarService} from '../day-time-calendar/day-time-calendar.service';
import {DayCalendarService} from '../day-calendar/day-calendar.service';
import {TimeSelectService} from '../time-select/time-select.service';
const moment = momentNs;

describe('Service: DatePicker', () => {
beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/app/date-picker/date-picker.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {EventEmitter, Injectable} from '@angular/core';
import {IDatePickerConfig, IDatePickerConfigInternal} from './date-picker-config.model';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {IDayCalendarConfig} from '../day-calendar/day-calendar-config.model';
import {TimeSelectService} from '../time-select/time-select.service';
import {DayTimeCalendarService} from '../day-time-calendar/day-time-calendar.service';
import {ITimeSelectConfig} from '../time-select/time-select-config.model';
import {CalendarMode} from '../common/types/calendar-mode';
const moment = momentNs;

@Injectable()
export class DatePickerService {
Expand Down
3 changes: 2 additions & 1 deletion src/app/day-calendar/day-calendar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {UtilsService} from '../common/services/utils/utils.service';
import {CalendarNavComponent} from '../calendar-nav/calendar-nav.component';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {DayCalendarComponent} from './day-calendar.component';
import {DayCalendarService} from './day-calendar.service';
import {MonthCalendarComponent} from '../month-calendar/month-calendar.component';
import {IDay} from './day.model';
const moment = momentNs;

describe('Component: DayCalendarComponent', () => {
let component: DayCalendarComponent;
Expand Down
7 changes: 4 additions & 3 deletions src/app/day-calendar/day-calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
ViewEncapsulation
} from '@angular/core';
import {DayCalendarService} from './day-calendar.service';
import * as moment from 'moment';
import {Moment} from 'moment';
import * as momentNs from 'moment';
import {Moment, unitOfTime} from 'moment';
import {IDayCalendarConfig, IDayCalendarConfigInternal} from './day-calendar-config.model';
import {IDay} from './day.model';
import {
Expand All @@ -35,6 +35,7 @@ import {IMonthCalendarConfig} from '../month-calendar/month-calendar-config';
import {IMonth} from '../month-calendar/month.model';
import {DateValidator} from '../common/types/validator.type';
import {INavEvent} from '../common/models/navigation-event.model';
const moment = momentNs;

@Component({
selector: 'dp-day-calendar',
Expand Down Expand Up @@ -298,7 +299,7 @@ export class DayCalendarComponent implements OnInit, OnChanges, ControlValueAcce
this.onMonthSelect.emit(month);
}

moveCalendarsBy(current: Moment, amount: number, granularity: moment.unitOfTime.Base = 'month') {
moveCalendarsBy(current: Moment, amount: number, granularity: unitOfTime.Base = 'month') {
this.currentDateView = current.clone().add(amount, granularity);
this.cd.markForCheck();
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/day-calendar/day-calendar.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {inject, TestBed} from '@angular/core/testing';
import {DayCalendarService} from './day-calendar.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {IDayCalendarConfig, IDayCalendarConfigInternal} from './day-calendar-config.model';
import {IDayCalendarConfigInternal} from './day-calendar-config.model';
const moment = momentNs;

describe('Service: Calendar', () => {
beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/app/day-calendar/day-calendar.service.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Injectable} from '@angular/core';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {WeekDays} from '../common/types/week-days.type';
import {UtilsService} from '../common/services/utils/utils.service';
import {IDay} from './day.model';
import {IDayCalendarConfig, IDayCalendarConfigInternal} from './day-calendar-config.model';
import {IMonthCalendarConfig} from '../month-calendar/month-calendar-config';
const moment = momentNs;

@Injectable()
export class DayCalendarService {
Expand Down
3 changes: 2 additions & 1 deletion src/app/day-time-calendar/day-time-calendar.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {inject, TestBed} from '@angular/core/testing';
import {DayTimeCalendarService} from './day-time-calendar.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {DayCalendarService} from '../day-calendar/day-calendar.service';
import {TimeSelectService} from '../time-select/time-select.service';
import {IDayCalendarConfigInternal} from '../day-calendar/day-calendar-config.model';
const moment = momentNs;

const DAY_FORMAT = 'YYYYMMDD';
const TIME_FORMAT = 'HH:mm:ss';
Expand Down
3 changes: 2 additions & 1 deletion src/app/day-time-calendar/day-time-calendar.service.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Injectable} from '@angular/core';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';

import {UtilsService} from '../common/services/utils/utils.service';
import {DayCalendarService} from '../day-calendar/day-calendar.service';
import {TimeSelectService} from '../time-select/time-select.service';
import {IDayTimeCalendarConfig} from './day-time-calendar-config.model';
const moment = momentNs;

const DAY_FORMAT = 'YYYYMMDD';
const TIME_FORMAT = 'HH:mm:ss';
Expand Down
5 changes: 3 additions & 2 deletions src/app/demo/demo/demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import debounce from '../../common/decorators/decorators';
import {IDatePickerConfig} from '../../date-picker/date-picker-config.model';
import {DatePickerComponent} from '../../date-picker/date-picker.component';
import {DatePickerDirective} from '../../date-picker/date-picker.directive';
import {Component, ContentChild, HostListener, ViewChild} from '@angular/core';
import {Component, HostListener, ViewChild} from '@angular/core';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {GaService} from '../services/ga/ga.service';
import {ECalendarValue} from '../../common/types/calendar-value-enum';
import {INavEvent} from '../../common/models/navigation-event.model';
const moment = momentNs;

const GLOBAL_OPTION_KEYS = [
'theme',
Expand Down
7 changes: 4 additions & 3 deletions src/app/month-calendar/month-calendar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import {MonthCalendarComponent} from './month-calendar.component';
import {UtilsService} from '../common/services/utils/utils.service';
import {CalendarNavComponent} from '../calendar-nav/calendar-nav.component';
import {MonthCalendarService} from './month-calendar.service';
import * as moment from 'moment';
import {IMonth} from './month.model';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {IMonth} from './month.model';
const moment = momentNs;

describe('Component: MonthCalendarComponent', () => {
let component: MonthCalendarComponent;
Expand Down Expand Up @@ -37,7 +38,7 @@ describe('Component: MonthCalendarComponent', () => {
disabled: false,
text: ''
};
const defaultCssClasses: { [klass: string]: boolean } = {
const defaultCssClasses: {[klass: string]: boolean} = {
'dp-selected': false,
'dp-current-month': false
};
Expand Down
3 changes: 2 additions & 1 deletion src/app/month-calendar/month-calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@angular/core';
import {IMonth} from './month.model';
import {MonthCalendarService} from './month-calendar.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {IMonthCalendarConfig, IMonthCalendarConfigInternal} from './month-calendar-config';
import {
Expand All @@ -32,6 +32,7 @@ import {UtilsService} from '../common/services/utils/utils.service';
import {DateValidator} from '../common/types/validator.type';
import {SingleCalendarValue} from '../common/types/single-calendar-value';
import {INavEvent} from '../common/models/navigation-event.model';
const moment = momentNs;

@Component({
selector: 'dp-month-calendar',
Expand Down
3 changes: 2 additions & 1 deletion src/app/month-calendar/month-calendar.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {inject, TestBed} from '@angular/core/testing';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {MonthCalendarService} from './month-calendar.service';
import {IMonth} from './month.model';
const moment = momentNs;

describe('Service: MonthCalendarService', () => {
beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/app/month-calendar/month-calendar.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {Injectable} from '@angular/core';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {IMonth} from './month.model';
import {IMonthCalendarConfig, IMonthCalendarConfigInternal} from './month-calendar-config';
const moment = momentNs;

@Injectable()
export class MonthCalendarService {
Expand Down
3 changes: 2 additions & 1 deletion src/app/time-select/time-select.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {UtilsService} from '../common/services/utils/utils.service';
import {CalendarNavComponent} from '../calendar-nav/calendar-nav.component';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {TimeSelectComponent} from './time-select.component';
import {TimeSelectService} from './time-select.service';
import {MonthCalendarComponent} from '../month-calendar/month-calendar.component';
const moment = momentNs;

describe('Component: TimeSelectComponent', () => {
let component: TimeSelectComponent;
Expand Down
3 changes: 2 additions & 1 deletion src/app/time-select/time-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
ViewEncapsulation
} from '@angular/core';
import {TimeSelectService, TimeUnit} from './time-select.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {ITimeSelectConfig, ITimeSelectConfigInternal} from './time-select-config.model';
import {
Expand All @@ -30,6 +30,7 @@ import {CalendarValue} from '../common/types/calendar-value';
import {UtilsService} from '../common/services/utils/utils.service';
import {IDate} from '../common/models/date.model';
import {DateValidator} from '../common/types/validator.type';
const moment = momentNs;

@Component({
selector: 'dp-time-select',
Expand Down
3 changes: 2 additions & 1 deletion src/app/time-select/time-select.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {inject, TestBed} from '@angular/core/testing';
import {TimeSelectService} from './time-select.service';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {ITimeSelectConfigInternal} from './time-select-config.model';
const moment = momentNs;

describe('Service: TimeSelectService', () => {
beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/app/time-select/time-select.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Injectable} from '@angular/core';
import * as moment from 'moment';
import * as momentNs from 'moment';
import {Moment} from 'moment';
import {UtilsService} from '../common/services/utils/utils.service';
import {ITimeSelectConfig, ITimeSelectConfigInternal} from './time-select-config.model';
const moment = momentNs;

export type TimeUnit = 'hour' | 'minute' | 'second';
export const FIRST_PM_HOUR = 12;
Expand Down