Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="main">
<div id="gcCalendar">
  </div>  
</div>

              
            
!

CSS

              
                .main{
  margin-top: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.gcim-calendar{
  width: 290px;
}
/* 休日のスタイル */
[calendar-holiday-type|="年末年始休業期間"] {
  background-color: #fa6775;
  color: white;
  font-style: italic;
  border: solid 1px white;
}

[calendar-holiday-type|="天皇誕生日"]{
  color: red;
}

[calendar-holiday-type|="成人の日"]{
  color: red;
}

/* コントロールのスタイル */
.gcim-calendar__outter-container {
  background-color: #f9f9f9;
}

/* ヘッダのスタイル */
.gcim-calendar__header {
  background-color: #1995ad;
  color: white;
}

/* 曜日タイトルのスタイル */
.gcim-calendar__month-body__corner-cell, .gcim-calendar__month-body__week-title {
  background-color: #a1d6e2;
}

/* 曜日のスタイル */
.gcim-calendar__weekday_sunday {
  color: red;
}
.gcim-calendar__weekday_saturday {
  color: blue;
}
.gcim-calendar__weekday_monday,
.gcim-calendar__weekday_tuesday,
.gcim-calendar__weekday_wednesday,
.gcim-calendar__weekday_thursday,
.gcim-calendar__weekday_friday {
    color: #404040;
}

/* 今日の日付ボタンのスタイル */
.gcim-calendar__today-button {
  color: #1995ad;
}

              
            
!

JS

              
                GC.InputMan.LicenseKey = "GrapeCity-Internal-Use-Only,E533581452858357#B0T8nyd92SaOJGMJRneVdXcXRlNrMGNnxUYoRVRrlVNNZ4Y4cTRYFUWyQmYlFzQ9lkTwFHdyUFTulFM5h7NiVUMhdVVyEkckJUO4VjVyVnQ8VTQkJkUDVUaKlEUzEWOn54V5VDdxc7dyVzSn5kaOVlZ4dWN7w4VJ96V6cVVRNDeVREWEtESrhzY4MkdiBTaxYnNvlGO8AVRvYEUjZGbw8EbKBVQDVFUyp5MNpFNywka5hjTENlcGNzURlzSWRDeZRHSFRESBpVcyM4LCJUV4JmWtNnYzcDTCNjTjZDMSlHcRRTcltCbxMUZzRnUwlmI0IyUiwiIEVENBdjQEdjI0ICSiwiM4YzN9UDM7ETM0IicfJye&Qf35VfioUSLljI0IyQiwiIyYHITpEIuFWT4VHculkI0IiTis7W0ICZyBlIsIyNyEzM5ADI5ITMxkTMwIjI0ICdyNkIsIybp9ibwR6YiojIz5GRiwiI+S09ayL9Pyb9qCq9jK88GO887K88XO882O88sO88wK88iojIh94QiwSZ5JHd0ICb6VkIsIyN5MDO5gjM5QTM8UzMzUjI0ICZJJye0ICRiwiI34TQMpnaBhWSkFVOBFkSQl6Rrl6LXZ6Y534d5pXRrR4NwtEUj3GetFUWyZzSUtmNXJXV9RmaYl5cOZHeJNUOpBHbOhzLoZkRhZ6V7h5dj9ESIRnaNN6Rq3kUrsGcuZFZNhkanNDTvYnPhqW"

var GCIM = GC.InputMan;
var gcCalendar = new GCIM.GcCalendar(document.getElementById('gcCalendar'));

gcCalendar.setCalendarDimensions(2, 1);
gcCalendar.setShowWeekNumber(false);
gcCalendar.setHeaderFormat('gggE年 M月');

// 表示するのを今月のみに固定
var today = new Date();
gcCalendar.setMinDate(new Date("2018/12/1"));
gcCalendar.setMaxDate(new Date("2019/1/31"));

gcCalendar.getWeekday('sunday').setWeekFlags(GCIM.WeekFlags.All);
gcCalendar.getWeekday('monday').setWeekFlags(GCIM.WeekFlags.All);
gcCalendar.getWeekday('tuesday').setWeekFlags(GCIM.WeekFlags.All);
gcCalendar.getWeekday('wednesday').setWeekFlags(GCIM.WeekFlags.All);
gcCalendar.getWeekday('thursday').setWeekFlags(GCIM.WeekFlags.All);
gcCalendar.getWeekday('friday').setWeekFlags(GCIM.WeekFlags.All);
gcCalendar.getWeekday('saturday').setWeekFlags(GCIM.WeekFlags.All);

// 休日の設定
var holidayLabel = '年末年始休業期間';
var holidayGroup = new GCIM.HolidayGroup(holidayLabel, true);
holidayGroup.addHoliday(new GCIM.Holiday(holidayLabel, 12, 28, 12, 31));
holidayGroup.addHoliday(new GCIM.Holiday(holidayLabel, 1, 1, 1, 6));
holidayGroup.addHoliday(new GCIM.ForceHoliday('天皇誕生日', '2018/12/23'));
holidayGroup.addHoliday(new GCIM.ForceWorkday('営業開始日', '2019/1/7'));
holidayGroup.addHoliday(new GCIM.DayOfWeekHoliday('成人の日', GCIM.MonthFlags.January, GCIM.WeekFlags.Second, GCIM.DayOfWeek.Monday));

// 振替休日を有効にします
holidayGroup.setWeekFlags('sunday', GCIM.WeekFlags.All);
holidayGroup.setOverride('sunday', GCIM.HolidayOverride.NextWorkDay);

gcCalendar.addHolidayGroup(holidayGroup);

              
            
!
999px

Console