Created
February 10, 2017 08:03
-
-
Save shimakyohsuke/5a984bf6aa228b0f696ed6b8b7940f12 to your computer and use it in GitHub Desktop.
pug で年月日できる mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- +year_month_day(ture || false, start_year, end_year) | |
mixin year_month_day(required, start_year, end_year) | |
select(name='year', required=required) | |
option(value='', selected='selected') - | |
- var y = start_year | |
while y <= end_year | |
option(value=y + '年')=y++ + '年' | |
select(name='month', required=required) | |
option(value='', selected='selected') - | |
- var m = 1 | |
while m <= 12 | |
option(value=m + '月')=m++ + '月' | |
select(name='day', required=required) | |
option(value='', selected='selected') - | |
- var d = 1 | |
while d <= 31 | |
option(value=d + '日')=d++ + '日' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment