Skip to content

Commit

Permalink
Update to beta.16
Browse files Browse the repository at this point in the history
  • Loading branch information
fknop committed Apr 28, 2016
1 parent 7173d22 commit f6aeda0
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CalendarPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class CalendarPipe implements PipeTransform, OnDestroy {
CalendarPipe._midnight.subscribe(() => this._cdRef.markForCheck());
}

transform(value: Date | moment.Moment, args?: any[]): any {
transform(value: Date | moment.Moment, ...args: any[]): any {
return momentConstructor(value).calendar();
}

Expand Down
2 changes: 1 addition & 1 deletion DateFormatPipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('DateFormatPipe', () => {
describe('#transform', () => {
it('should properly format a date', () => {
const pipe = new DateFormatPipe();
const result = pipe.transform(moment('2016-01-24 01:23:45'), ['MMMM Do YYYY, h:mm:ss a']);
const result = pipe.transform(moment('2016-01-24 01:23:45'), 'MMMM Do YYYY, h:mm:ss a');
expect(result).toBe('January 24th 2016, 1:23:45 am');
});
});
Expand Down
2 changes: 1 addition & 1 deletion DateFormatPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const momentConstructor: (value?: any) => moment.Moment = (<any>moment).default

@Pipe({ name: 'amDateFormat', pure: false })
export class DateFormatPipe implements PipeTransform {
transform(value: Date | moment.Moment, args?: any[]): any {
transform(value: Date | moment.Moment, ...args: any[]): any {
return momentConstructor(value).format(args[0]);
}
}
10 changes: 5 additions & 5 deletions DurationPipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ describe('DurationPipe', () => {
});

it('should convert a duration to a human-readable string', () => {
expect(pipe.transform(24, ['hours'])).toEqual('a day');
expect(pipe.transform(27, ['days'])).toEqual('a month');
expect(pipe.transform(365, ['seconds'])).toEqual('6 minutes');
expect(pipe.transform(365, ['days'])).toEqual('a year');
expect(pipe.transform(86400, ['seconds'])).toEqual('a day');
expect(pipe.transform(24, 'hours')).toEqual('a day');
expect(pipe.transform(27, 'days')).toEqual('a month');
expect(pipe.transform(365, 'seconds')).toEqual('6 minutes');
expect(pipe.transform(365, 'days')).toEqual('a year');
expect(pipe.transform(86400, 'seconds')).toEqual('a day');
});
});
});
2 changes: 1 addition & 1 deletion DurationPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as moment from 'moment';

@Pipe({ name: 'amDuration' })
export class DurationPipe implements PipeTransform {
transform(value: any, args?: string[]): string {
transform(value: any, ...args: string[]): string {
if (typeof args === 'undefined' || args.length !== 1) {
throw new Error('DurationPipe: missing required time unit argument');
}
Expand Down
2 changes: 1 addition & 1 deletion FromUnixPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as moment from 'moment';

@Pipe({ name: 'amFromUnix' })
export class FromUnixPipe implements PipeTransform {
transform(value: any, args?: string[]): any {
transform(value: any, ...args: string[]): any {
if (typeof value === 'string') {
value = +value;
}
Expand Down
2 changes: 1 addition & 1 deletion TimeAgoPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {
constructor(private _cdRef: ChangeDetectorRef) {
}

transform(value: Date | moment.Moment, args?: any[]): any {
transform(value: Date | moment.Moment, ...args: any[]): any {
const momentInstance = momentConstructor(value);
this._removeTimer();
const timeToUpdate = this._getSecondsUntilUpdate(momentInstance) * 1000;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"moment": "^2.11.2"
},
"devDependencies": {
"angular2": "2.0.0-beta.12",
"angular2": "2.0.0-beta.16",
"es6-promise": "3.1.2",
"es6-shim": "0.35.0",
"jasmine-core": "2.4.1",
Expand Down

0 comments on commit f6aeda0

Please sign in to comment.