Skip to content

Commit 59ae9c2

Browse files
author
pipeline
committed
feature(EJ2-3069): Calendar plunker support committed
1 parent 2102c8e commit 59ae9c2

File tree

9 files changed

+33
-31
lines changed

9 files changed

+33
-31
lines changed

src/calendar/default.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
</div>
99
<div id="description">
1010
<p>
11-
<b>Calendar</b> is a graphical user interface control which provides the multi-view representation to display and select a date.Also, provide options to navigate in different levels of views like month, year, decade.
11+
A <code>Calendar</code> is a graphical user interface control which provides the multi-view representation to display and select a date. Also, provide options to navigate in different levels of views like month, year, decade.
1212
</p>
13+
<p>More information on the calendar instantiation can be found in this
14+
<a href="http://ej2.syncfusion.com/documentation/calendar/getting-started.html#create-a-simple-calendar" target="_blank"> documentation section</a>.</p>
1315
</div>
1416
<style>
1517
#wrapper {

src/calendar/disabled.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</div>
99
<div id="description">
1010
<p>
11-
Disabled Dates sample demonstrates, how to disable a specific dates in a calendar by using <b>renderDayCell</b> event. This event gets triggered on each day cell element creation that allows you to customize or disable the specific dates in calendar.
12-
</p>
13-
<p>
14-
Here, weekend date's are disabled by setting <b>args.disabled</b> as true.
11+
Disabled Dates sample demonstrates, how to disable a specific dates in a calendar by using <code>renderDayCell</code> event. This event gets triggered on each day cell element creation that allows you to customize or disable the specific dates
12+
in calendar. Here, weekend date's are disabled by setting <code>args.disabled</code> as true.
1513
</p>
14+
<p>More information on the calendar customization can be found in this
15+
<a href="http://ej2.syncfusion.com/documentation/calendar/getting-started.html" target="_blank"> documentation section</a>.</p>
1616
</div>
1717
<style>
1818
#date_label {

src/calendar/internationalization-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/calendar/internationalization.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
<select id="cultures" class="form-control">
1919
<option value="de">de</option>
2020
<option value="en">en</option>
21-
<option value="zh">zh</option>
21+
<option value="zh">zh</option>
22+
<option value="vi">vi</option>
2223
</select>
2324
</div>
2425
</td>
@@ -27,11 +28,10 @@
2728
</div>
2829
<div id="description">
2930
<p>
30-
The calendar control was rendered with <b>German</b> culture.Here the date separator ,week header and month text content are updated based on current culture.
31-
</p>
32-
<p>
33-
you can also change the control culture by selecting it from the culture options in the properties panel.
31+
The calendar control was rendered with <code>German</code> culture. Here the date separator, week header and month text content are updated based on current culture. you can also change the control culture by selecting it from the culture options
32+
in the properties panel.
3433
</p>
34+
<p>More information on the internationalization configuration can be found in this <a href="http://ej2.syncfusion.com/documentation/base/intl.html" target="_blank"> documentation section</a>.</p>
3535
</div>
3636
<style>
3737
.property-panel-content {
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import { Calendar, ChangedEventArgs } from '@syncfusion/ej2-calendars';
22
import { loadCldr, Internationalization } from '@syncfusion/ej2-base';
3+
import * as numberingSystems from '../common/cldr-data/supplemental/numberingSystems.json';
4+
import * as zhgregorian from '../common/cldr-data/main/zh/ca-gregorian.json';
5+
import * as zhnumbers from '../common/cldr-data/main/zh/numbers.json';
6+
import * as degregorian from '../common/cldr-data/main/de/ca-gregorian.json';
7+
import * as denumbers from '../common/cldr-data/main/de/numbers.json';
8+
import * as vigregorian from '../common/cldr-data/main/vi/ca-gregorian.json';
9+
import * as vinumbers from '../common/cldr-data/main/vi/numbers.json';
310
/**
411
* Internationalization calendar sample
512
*/
613

714
this.default = (): void => {
8-
loadCldr(
9-
require('../common/cldr-data/supplemental/numberingSystems.json'),
10-
require('../common/cldr-data/main/zh/ca-gregorian.json'),
11-
require('../common/cldr-data/main/zh/timeZoneNames.json'),
12-
require('../common/cldr-data/main/zh/numbers.json'),
13-
require('../common/cldr-data/main/zh/currencies.json'),
14-
require('../common/cldr-data/main/de/ca-gregorian.json'),
15-
require('../common/cldr-data/main/de/timeZoneNames.json'),
16-
require('../common/cldr-data/main/de/numbers.json'),
17-
require('../common/cldr-data/main/de/currencies.json')
18-
);
15+
// loadCldr method to load the culture specific JSON file.
16+
loadCldr(numberingSystems, zhgregorian, zhnumbers, degregorian, denumbers, vigregorian, vinumbers);
1917
let calendar: Calendar = new Calendar({
2018
change: valueChange, locale: 'de', value: new Date()
2119
});
@@ -34,4 +32,4 @@ this.default = (): void => {
3432
(<HTMLInputElement>document.getElementById('date_label')).textContent = 'Selected Value: ' + globalize.formatDate(calendar.value);
3533
calendar.dataBind();
3634
}
37-
};
35+
};

src/calendar/range.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</div>
99
<div id="description">
1010
<p>
11-
Date Range sample illustrates the date selection within a specific range in a calendar by using <b>min</b> and <b>max</b> properties.
12-
</p>
13-
<p>
14-
Here, the date selection range was resricted within 5/5/2017 - 5/27/2017.
11+
Date Range sample illustrates the date selection within a specific range in a calendar by using <code>min</code> and <code>max</code> properties. Here, the date selection range was resricted within 5/5/2017 - 5/27/2017.
1512
</p>
13+
<p>More information on the date range restriction can be found in this
14+
<a href="http://ej2.syncfusion.com/documentation/calendar/getting-started.html#range" target="_blank"> documentation section</a>.</p>
15+
1616
</div>
1717
<style>
1818
.control_wrapper #container {

src/calendar/special-plnkr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"index.ts":"import { Calendar, RenderDayCellEventArgs, ChangedEventArgs } from '@syncfusion/ej2-calendars';\n/**\n * Special calendar sample\n */\n\n\n let calendar: Calendar = new Calendar({\n renderDayCell: customDates, change: valueChange\n });\n calendar.appendTo('#calendar');\n\nfunction customDates(args: RenderDayCellEventArgs): void {\n if (args.date.getDate() === 10) {\n let span: HTMLElement;\n span = document.createElement('span');\n span.setAttribute('class', 'e-icons highlight');\n args.element.appendChild(span);\n args.element.setAttribute('title', 'Birthday !');\n args.element.setAttribute('data-val', 'Birthday !');\n }\n if (args.date.getDate() === 15) {\n args.element.className = 'special';\n args.element.setAttribute('title', 'Farewell');\n args.element.setAttribute('data-val', 'Farewell !');\n }\n if (args.date.getDate() === 20) {\n args.element.className = 'daycell';\n }\n}\nfunction valueChange(args: ChangedEventArgs): void {\n let title: string = (<HTMLElement>event.currentTarget).querySelector('.e-link').getAttribute('data-val');\n title = title == null ? '' : ' ( ' + title + ' )';\n (<HTMLInputElement>document.getElementById('date_label')).textContent = 'Selected Value: ' + args.value.toLocaleDateString() + title;\n}","index.html":"<html><head>\n <link href=\"http://ej2ci.syncfusion.com/production/demos/styles/material.css\" rel=\"stylesheet\">\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js\"></script>\n <script src=\"systemjs.config.js\"></script>\n</head>\n<body>\n<div class=\"col-lg-12 control-section\">\n <div class=\"control_wrapper\">\n <div id=\"container\">\n <div id=\"calendar\"></div><br>\n </div>\n <span id=\"date_label\"> Selected Value: </span>\n </div>\n</div>\n\n<style>\n .control_wrapper #container {\n min-height: 310px;\n }\n \n .e-bigger .control_wrapper #container {\n min-height: 400px;\n }\n \n #date_label {\n display: block;\n width: 248px;\n color: rgba(0, 0, 0, 0.58);\n }\n \n .control_wrapper {\n max-width: 350px;\n margin: 0 auto;\n }\n \n span.e-icons.highlight {\n margin-top: -13px;\n display: block;\n margin-left: 4px;\n }\n \n span.e-icons.highlight,\n span.e-icons.highlight:before {\n color: rgb(0, 0, 255);\n }\n \n span.e-icons.highlight:before {\n content: \"\\e865\";\n vertical-align: middle;\n margin-right: 3px;\n font-size: 4px;\n position: relative;\n top: -1px;\n font-weight: normal;\n }\n \n .e-bigger.e-calendar span.e-icons.highlight:before,\n .e-bigger .e-calendar span.e-icons.highlight:before {\n top: -3px;\n }\n \n .e-selected span.e-icons.highlight:before {\n color: #fff;\n }\n \n span.e-icons.highlight,\n .e-calendar .e-content span.special,\n .e-calendar .e-content span.daycell {\n font-weight: bold;\n }\n \n .e-calendar .e-content span.special {\n color: red;\n }\n \n .e-calendar .e-content span.daycell {\n color: #ff9e00;\n }\n</style>\n\n</body></html>","systemjs.config.js":"System.config({\n transpiler: \"typescript\",\n typescriptOptions: {\n compilerOptions: {\n target: \"umd\",\n module: \"commonjs\",\n moduleResolution: \"node\",\n emitDecoratorMetadata: true,\n experimentalDecorators: true\n }\n },\n paths: {\n \"syncfusion:\": \"http://ej2ci.syncfusion.com/packages/production/\"\n },\n map: {\n main: \"index.ts\",\n typescript: \"https://unpkg.com/[email protected]/lib/typescript.js\",\n 'plugin-json':'https://cdnjs.cloudflare.com/ajax/libs/systemjs-plugin-json/0.3.0/json.min.js',\n \"@syncfusion/ej2-base\": \"syncfusion:ej2-base/dist/ej2-base.umd.min.js\",\n \"@syncfusion/ej2-buttons\": \"syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js\",\n \"@syncfusion/ej2-calendars\": \"syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js\",\n \"@syncfusion/ej2-charts\": \"syncfusion:ej2-charts/dist/ej2-charts.umd.min.js\",\n \"@syncfusion/ej2-data\": \"syncfusion:ej2-data/dist/ej2-data.umd.min.js\",\n \"@syncfusion/ej2-grids\": \"syncfusion:ej2-grids/dist/ej2-grids.umd.min.js\", \n \"@syncfusion/ej2-inputs\": \"syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js\", \n \"@syncfusion/ej2-lists\": \"syncfusion:ej2-lists/dist/ej2-lists.umd.min.js\",\n \"@syncfusion/ej2-navigations\": \"syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js\", \n \"@syncfusion/ej2-popups\": \"syncfusion:ej2-popups/dist/ej2-popups.umd.min.js\", \n \"@syncfusion/ej2-circulargauge\": \"syncfusion:ej2-circulargauge/dist/ej2-circulargauge.umd.min.js\", \n },\n meta: { \n '*.json': { loader: 'plugin-json' }\n }\n});\n\nSystem.import('index.ts').catch(console.error.bind(console));"}
1+
{"index.ts":"import { Calendar, RenderDayCellEventArgs, ChangedEventArgs } from '@syncfusion/ej2-calendars';\n/**\n * Special calendar sample\n */\n\n\n let calendar: Calendar = new Calendar({\n renderDayCell: customDates, change: valueChange\n });\n calendar.appendTo('#calendar');\n\nfunction customDates(args: RenderDayCellEventArgs): void {\n if (args.date.getDate() === 10) {\n let span: HTMLElement;\n span = document.createElement('span');\n span.setAttribute('class', 'e-icons highlight');\n args.element.appendChild(span);\n args.element.setAttribute('title', 'Birthday !');\n args.element.setAttribute('data-val', 'Birthday !');\n }\n if (args.date.getDate() === 15) {\n args.element.className = 'special';\n args.element.setAttribute('title', 'Farewell');\n args.element.setAttribute('data-val', 'Farewell !');\n }\n if (args.date.getDate() === 20) {\n args.element.className = 'daycell';\n }\n}\nfunction valueChange(args: ChangedEventArgs): void {\n let title: string = (<HTMLElement>event.currentTarget).querySelector('.e-day').getAttribute('data-val');\n title = title == null ? '' : ' ( ' + title + ' )';\n (<HTMLInputElement>document.getElementById('date_label')).textContent = 'Selected Value: ' + args.value.toLocaleDateString() + title;\n}","index.html":"<html><head>\n <link href=\"http://ej2ci.syncfusion.com/production/demos/styles/material.css\" rel=\"stylesheet\">\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js\"></script>\n <script src=\"systemjs.config.js\"></script>\n</head>\n<body>\n<div class=\"col-lg-12 control-section\">\n <div class=\"control_wrapper\">\n <div id=\"container\">\n <div id=\"calendar\"></div><br>\n </div>\n <span id=\"date_label\"> Selected Value: </span>\n </div>\n</div>\n\n<style>\n .control_wrapper #container {\n min-height: 310px;\n }\n \n .e-bigger .control_wrapper #container {\n min-height: 400px;\n }\n \n #date_label {\n display: block;\n width: 248px;\n color: rgba(0, 0, 0, 0.58);\n }\n \n .control_wrapper {\n max-width: 350px;\n margin: 0 auto;\n }\n \n span.e-icons.highlight {\n margin-top: -13px;\n display: block;\n margin-left: 4px;\n }\n \n span.e-icons.highlight,\n span.e-icons.highlight:before {\n color: rgb(0, 0, 255);\n }\n \n span.e-icons.highlight:before {\n content: \"\\e865\";\n vertical-align: middle;\n margin-right: 3px;\n font-size: 4px;\n position: relative;\n top: -1px;\n font-weight: normal;\n }\n \n .e-bigger.e-calendar span.e-icons.highlight:before,\n .e-bigger .e-calendar span.e-icons.highlight:before {\n top: -3px;\n }\n \n .e-selected span.e-icons.highlight:before {\n color: #fff;\n }\n \n span.e-icons.highlight,\n .e-calendar .e-content span.special,\n .e-calendar .e-content span.daycell {\n font-weight: bold;\n }\n \n .e-calendar .e-content span.special {\n color: red;\n }\n \n .e-calendar .e-content span.daycell {\n color: #ff9e00;\n }\n</style>\n\n</body></html>","systemjs.config.js":"System.config({\n transpiler: \"typescript\",\n typescriptOptions: {\n compilerOptions: {\n target: \"umd\",\n module: \"commonjs\",\n moduleResolution: \"node\",\n emitDecoratorMetadata: true,\n experimentalDecorators: true\n }\n },\n paths: {\n \"syncfusion:\": \"http://ej2ci.syncfusion.com/packages/production/\"\n },\n map: {\n main: \"index.ts\",\n typescript: \"https://unpkg.com/[email protected]/lib/typescript.js\",\n 'plugin-json':'https://cdnjs.cloudflare.com/ajax/libs/systemjs-plugin-json/0.3.0/json.min.js',\n \"@syncfusion/ej2-base\": \"syncfusion:ej2-base/dist/ej2-base.umd.min.js\",\n \"@syncfusion/ej2-buttons\": \"syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js\",\n \"@syncfusion/ej2-calendars\": \"syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js\",\n \"@syncfusion/ej2-charts\": \"syncfusion:ej2-charts/dist/ej2-charts.umd.min.js\",\n \"@syncfusion/ej2-data\": \"syncfusion:ej2-data/dist/ej2-data.umd.min.js\",\n \"@syncfusion/ej2-grids\": \"syncfusion:ej2-grids/dist/ej2-grids.umd.min.js\", \n \"@syncfusion/ej2-inputs\": \"syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js\", \n \"@syncfusion/ej2-lists\": \"syncfusion:ej2-lists/dist/ej2-lists.umd.min.js\",\n \"@syncfusion/ej2-navigations\": \"syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js\", \n \"@syncfusion/ej2-popups\": \"syncfusion:ej2-popups/dist/ej2-popups.umd.min.js\", \n \"@syncfusion/ej2-circulargauge\": \"syncfusion:ej2-circulargauge/dist/ej2-circulargauge.umd.min.js\", \n },\n meta: { \n '*.json': { loader: 'plugin-json' }\n }\n});\n\nSystem.import('index.ts').catch(console.error.bind(console));"}

src/calendar/special.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
</div>
99
<div id="description">
1010
<p>
11-
Special Dates sample demonstrates, how to customize a specific dates in a calendar by using <b>renderDayCell</b> event. This event gets triggered on each day cell element creation that allows you to customize or disable the specific dates in calendar.
11+
Special Dates sample demonstrates, how to customize a specific dates in a calendar by using <code>renderDayCell</code> event. This event gets triggered on each day cell element creation that allows you to customize or disable the specific dates
12+
in calendar. Here 10, 15 and 20 date's are customized with custom styles and custom classes.
1213
</p>
13-
<p>Here 10, 15 and 20 date's are customized with custom styles and custom classes. </p>
14+
<p>More information on the calendar customization can be found in this
15+
<a href="http://ej2.syncfusion.com/documentation/calendar/getting-started.html" target="_blank"> documentation section</a>.</p>
1416
</div>
1517
<style>
1618
.control_wrapper #container {

src/calendar/special.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function customDates(args: RenderDayCellEventArgs): void {
2828
}
2929
}
3030
function valueChange(args: ChangedEventArgs): void {
31-
let title: string = (<HTMLElement>event.currentTarget).querySelector('.e-link').getAttribute('data-val');
31+
let title: string = (<HTMLElement>event.currentTarget).querySelector('.e-day').getAttribute('data-val');
3232
title = title == null ? '' : ' ( ' + title + ' )';
3333
(<HTMLInputElement>document.getElementById('date_label')).textContent = 'Selected Value: ' + args.value.toLocaleDateString() + title;
3434
}

0 commit comments

Comments
 (0)