Skip to content

Instantly share code, notes, and snippets.

@onagatani
Last active April 9, 2018 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onagatani/bfbd7ca22ebe43a46ce4e17a093f8beb to your computer and use it in GitHub Desktop.
Save onagatani/bfbd7ca22ebe43a46ce4e17a093f8beb to your computer and use it in GitHub Desktop.
4月の祝日を取得し判定する例は以下になります。
<mt:JPHoliday month="201804">
<mt:IfJPHoliday date="2018-04-29">
今日は<$mt:JPHolidayName date="2018-04-29"$>の日です
</mt:IfJPHoliday>
</mt:JPHoliday>
MTCalenderと組合わせて利用する例
<mt:JPHoliday month="201804">
<mt:Calendar month="201804">
<mt:CalendarWeekHeader><tr></mt:CalendarWeekHeader>
<mt:CalendarIfBlank>
<td>&nbsp;</td>
<mt:Else>
<mt:IfJPHoliday>
<mt:SetVarBlock name="class"> class="holiday"</mt:SetVarBlock>
<mt:SetVarBlock name="title"><$mt:CalendarDate format="%Y年%m月%d日"$>(<$mt:JPHolidayName$>)</mt:SetVarBlock>
<mt:Else>
<mt:SetVarBlock name="title"><$mt:CalendarDate format="%Y年%m月%d日"$></mt:SetVarBlock>
<mt:If tag="CalendarDate" format="%w" eq="0">
<mt:SetVarblock name="class"> class="sunday"</mt:SetVarBlock>
<mt:ElseIf tag="CalendarDate" format="%w" eq="6">
<mt:SetVarBlock name="class"> class="saturday"</mt:SetVarBlock>
<mt:Else>
<$mt:SetVar name="class" value=""$>
</mt:If>
</mt:IfJPHoliday>
<td title="<$mt:GetVar name="title"$>"<$mt:GetVar name="class"$>>
<mt:CalendarIfEntries>
<a href="<mt:Entries lastn="1"><$mt:EntryPermalink$></mt:Entries>"><$mt:CalendarDay$></a>
</mt:CalendarIfEntries>
<mt:CalendarIfNoEntries>
<$mt:CalendarDay$>
</mt:CalendarIfNoEntries>
</td>
</mt:CalendarIfBlank>
<mt:CalendarWeekFooter></tr></mt:CalendarWeekFooter>
</mt:Calendar month="2018-04">
</mt:JPHoliday month="2018-04">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment