概要

カレンダー(GcCalendar)コントロールは、和暦表示や複数月の表示をはじめ、月をまたいだ複数の日付を同時に取得するなど、豊富な機能を備えています。また、国民の祝日や企業独自の休日などをユーザー定義の暦に設定できます。
import './styles.css'; import '@grapecity/inputman/CSS/gc.inputman-js.css'; import { Component, enableProdMode } from '@angular/core'; import GC from "@grapecity/inputman"; @Component({ selector: 'app-component', templateUrl: './src/app.component.html', }) export class AppComponent { public showRokuyou: GC.InputMan.Rokuyou = GC.InputMan.Rokuyou.All; public setWeekFlag(sender: GC.InputMan.GcCalendar) { var gcCalendar1 = sender; gcCalendar1.getWeekday('sunday').setWeekFlags(GC.InputMan.WeekFlags.All); gcCalendar1.getWeekday('saturday').setWeekFlags(GC.InputMan.WeekFlags.All); } } enableProdMode();
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>カレンダーコントロール - 概要</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> /* 日曜と休業日のスタイル */ .gcim-calendar__weekday_sunday, .gcim-calendar__weekday_wednesday { color: red; } /* 土曜のスタイル */ .gcim-calendar__weekday_saturday { color: blue; } </style> <!-- Polyfills --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.min.js"></script> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.js"></script> <script src="systemjs.config.js"></script> <script> // workaround to load 'rxjs/operators' from the rxjs bundle System.import('rxjs').then(function (m) { System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators)); System.import('./src/app.component.module'); }); </script> </head> <body> <app-component></app-component> </body> </html>
休業日<br> <gc-calendar (onInitialized)="setWeekFlag($event)"></gc-calendar> 和暦<br> <gc-calendar [headerFormat]="'gggE年 M月'" [yearMonthFormat]="'gggE年,M月'"></gc-calendar> 六曜<br> <gc-calendar [showRokuyou]="showRokuyou"></gc-calendar> 複数月<br> <gc-calendar [calendarDimensions]="[3,2]"></gc-calendar>
import { BrowserModule } from '@angular/platform-browser'; import { NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { InputManModule } from "@grapecity/inputman.angular"; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ InputManModule, BrowserModule, FormsModule, ], providers: [], bootstrap: [AppComponent], schemas: [ CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA ] }) export class AppModule { } // Bootstrap application with hash style navigation and global services. platformBrowserDynamic().bootstrapModule(AppModule);
/* 日曜と休業日のスタイル */ .gcim-calendar__weekday_sunday, .gcim-calendar__weekday_wednesday { color: red; } /* 土曜のスタイル */ .gcim-calendar__weekday_saturday { color: blue; }
(function (global) { System.config({ transpiler: 'ts', typescriptOptions: { tsconfig: true }, meta: { 'typescript': { "exports": "ts" }, '*.css': { loader: 'css' } }, paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader where to look for things map: { 'core-js': 'npm:core-js/client/shim.min.js', 'zone': 'npm:zone.js/dist/zone.min.js', //'reflect-metadata': 'npm:reflect-metadata/Reflect.js', 'rxjs': 'npm:rxjs/bundles/rxjs.umd.min.js', //'rxjs': 'npm:rxjs', //'rxjs/operators': 'npm:rxjs/operators', '@angular/core': 'npm:@angular/core/bundles/core.umd.min.js', '@angular/common': 'npm:@angular/common/bundles/common.umd.min.js', '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.min.js', '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.min.js', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.min.js', '@angular/http': 'npm:@angular/http/bundles/http.umd.min.js', '@angular/common/http': 'npm:@angular/common/bundles/common-http.umd.min.js', '@angular/router': 'npm:@angular/router/bundles/router.umd.min.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.min.js', '@grapecity/inputman': 'npm:@grapecity/inputman/index.js', '@grapecity/inputman.angular': 'npm:@grapecity/inputman.angular/bundles/grapecity-inputman.angular.umd.js', '@grapecity/inputman/CSS': 'npm:@grapecity/inputman/CSS', 'bootstrap.css': 'npm:bootstrap/dist/css/bootstrap.min.css', 'jszip': 'npm:jszip/dist/jszip.min.js', 'typescript': 'npm:typescript/lib/typescript.js', 'ts': 'npm:plugin-typescript/lib/plugin.js', 'css': 'npm:systemjs-plugin-css/css.js' }, // packages tells the System loader how to load when no filename and/or no extension packages: { src: { defaultExtension: 'ts' }, rxjs: { defaultExtension: 'js' }, "node_modules": { defaultExtension: 'js' }, "@grapecity/inputman": { defaultExtension: 'js' } } }); })(this);