<!-- Tested with ZK 6.0.2 --><!-- note the depends attribute should be zul.db
since ZK supports load package on demand
will not load all recuired package if you only
specify zul
according to lang.xml in zul project, it more
likely just load zul and zul.wgt by default -->
<package name="custom.zk.components" language="xul/html" depends="zul.db">
<widget name="Yearbox" />
<widget name="Monthbox" />
<script src="override.js"/>
</package>

Yearbox.js

The customized widget class for yearbox, simply extends original datebox since what we need is only the widget class "custom.zk.components.Yearbox" so we can use the API widget.$instanceof to detect whether a calendar pop is belongs to a yearbox.

The customized widget class for monthbox, simply extends original datebox since what we need is only the widget class "custom.zk.components.Monthbox" so we can use the API widget.$instanceof to detect whether a calendar pop is belongs to a monthbox.

Override zul.db.CalendarPop here, change default action according to the parent's class of calendar pop. We use the API widget.$instanceof to detect whether a calendar pop is belongs to a yearbox or a monthbox.

Yes, this article is for limited target audience that already know some knowledge of ZK (especially the complex structure of component definition), you probably need some other background knowledge to understand this article.