Add pollyfills for ie and firefox

Transactions
Dan 2017-09-20 19:46:12 -06:00
parent 5cf2e997dc
commit d15a60a040
7 changed files with 73 additions and 19 deletions

View File

@ -56,6 +56,7 @@ import { IconDirective } from './directives/icon.directive';
//Pipes
import { DurationPipe } from './pipes/duration.pipe';
import { SafeUrlPipe } from './pipes/safe-url.pipe';
import { OfbDatePipe } from './pipes/ofb-date.pipe';
const Routes =
[
@ -133,7 +134,8 @@ const Routes =
SafeUrlPipe,
EventsPageComponent,
AddEventPopupComponent,
EventLargeComponent
EventLargeComponent,
OfbDatePipe
],
imports: [
BrowserModule,

View File

@ -7,7 +7,7 @@
--><div class="info" (click)="toggleState()">
<span class="title">{{ title }}</span>
<br>
<span class="date">{{ startDate | date:'yyyy-MM-dd | h:mm a' }}</span>
<span class="date">{{ startDate | ofbDate:true }}</span>
<br>
<p class="description" [@toggleAnimationFade]="state">
{{ description }}

View File

@ -7,7 +7,7 @@
--><div class="info" (click)="toggleState()">
<span class="title">{{ title }}</span>
<br>
<span class="date">{{ date |date:'yyyy-MM-dd' }}</span> | <span class="author">{{ author }}</span>
<span class="date">{{ date |ofbDate:false }}</span> | <span class="author">{{ author }}</span>
<br>
<p class="description" [@toggleAnimationFade]="state">
{{ description }}

View File

@ -0,0 +1,8 @@
import { OfbDatePipe } from './ofb-date.pipe';
describe('OfbDatePipe', () => {
it('create an instance', () => {
const pipe = new OfbDatePipe();
expect(pipe).toBeTruthy();
});
});

View File

@ -0,0 +1,27 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'ofbDate'
})
export class OfbDatePipe implements PipeTransform {
transform(value: Date, time?: boolean): any {
var year = value.getFullYear();
var month = value.getMonth() + 1;
var day = value.getDate();
var m = month < 10 ? "0" + month : month;
var d = day < 10 ? "0" + day : day;
var datePart = year + "-" + m + "-" + d;
if (time){
var hour = value.getHours();
var minutes = value.getMinutes();
var m = minutes < 10 ? "0" + minutes : minutes;
var amPm = hour < 12 ? " AM" : " PM";
hour = hour > 12 ? hour - 12 : hour;
hour = hour == 0 ? 12 : hour;
return datePart + " | " + hour + ":" + m + amPm;
}
return datePart;
}
}

View File

@ -28,6 +28,7 @@
height: 100%;
width: 100%;
text-align: center;
overflow-y: auto;
}
.loader {
color: #ffffff;
@ -49,13 +50,29 @@
font-size: 16px;
margin: 5px auto;
}
.ie{
padding: 15px;
background-color: red;
color: white;
font-size: 24px;
}
.ie-small{
font-size: 16px;
}
</style>
</head>
<body>
<app-root>
<app-root>
<div class="loader-background">
<!--[if IE]>
<div class="ie">Oh No! Looks like your browser is pretty outdated so our site may not work correctly.
<p class="ie-small">Please consider updating</p>
</div>
<![endif]-->
<div class="loader">Old Fashion Baptist<p class="address">5003 Wynne Ave | Butte, MT 59701</p></div>
<div class="loader-small">Please Wait...</div>
<!--[if !IE]><!-->
<div class="loader-small">Please Wait...</div>
<!--<![endif]-->
<p class="service-times"><b>Service Times</b></p>
<p class="service-times">Sunday School: 10 AM</p>
<p class="service-times">Sunday Morning: 11 AM</p>

View File

@ -19,20 +19,20 @@
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.