igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

igxCalendar Template - Year and Month are not rendered on IE11 and Edge

Open ymita opened this issue 8 years ago • 5 comments

Description

Using the template for the subheader, Year and Month are not rendered on IE11 and Edge. On Chrome and Firefox, these are rendered.

Steps to reproduce

  1. Create an application using the code below, and run it
export class AppComponent {
  title = 'app';
  locale = "ja-JP";
  formatOptions = { day: "numeric", month: "long", weekday: "short", year: "numeric" };
  formatViews = { day: false, month: true, year: true };
}
<igx-calendar #calendar
    selection="multi"
    [locale]="locale">
    <ng-template igxCalendarSubheader let-format>
        <span (click)="format.yearView()">{{ format.year.combined }}</span>
        <span (click)="format.monthView()">{{ format.month.combined | titlecase }}</span>
    </ng-template>
</igx-calendar>

Result

Year and Month are not rendered on IE and Edge. Please refer to a screenshot. image

Expected result

Year and Month are rendered on IE and Edge, as same as Chrome and Firefox.

ymita avatar Mar 12 '18 04:03 ymita

Related https://github.com/IgniteUI/igniteui-docfx/issues/199

This is also noted at the bottom of the templating section of the readme: https://github.com/IgniteUI/igniteui-angular/blob/master/src/calendar/README.md#templating

kdinev avatar Mar 12 '18 08:03 kdinev

This pull request demonstrates how to do custom parsing for the template parts for IE/Edge, will be soon available on the Calendar Templating topic.

hanastasov avatar Mar 27 '18 09:03 hanastasov

@hanastasov Is the help topic available soon?

I enabled the polyfill in two ways but neither worked. Can you confirm this is the intended polyfill configuration with igxCalendar templating?

  1. Add reference to locale resource of the Intl polifill (English and Japanese in this case.)
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Ignite UI for Angular</title>
  <base href="/" />

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Titillium+Web:300,400,600,700" rel="stylesheet">
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.ja"></script>
</head>
<body>
  <app-root></app-root>
</body>
</html>

2. Import settings
/***************************************************************************************************
 * APPLICATION IMPORTS
 */

/**
 * Date formatting for igxCalendarComponent.
 * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
 */
import 'intl';  // Run `npm install --save intl`.
/**
 * Need to import at least one locale-data with intl.
 */
import 'intl/locale-data/jsonp/en';
import 'intl/locale-data/jsonp/ja';

In the attached sample, 1 is commented out and only 2 is enabled. igApp1.zip

ymita avatar Apr 25 '18 06:04 ymita

Hi Yuki,

Yes, the templating section is available in the Calendar help topic.

I will later investigate the sample attached.

hanastasov avatar Apr 25 '18 06:04 hanastasov

Hi Hristo, Thank you for pointing to the right direction. Based on the information on the documentation, I can see it is working on IE/Edge. Please disregard my question above.

ymita avatar Apr 26 '18 06:04 ymita