Last active
January 1, 2016 14:28
-
-
Save kovalevsky/8157607 to your computer and use it in GitHub Desktop.
Отображение разного текста в зависимости от дня недели и времени
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
{% if 'now' | date: "%w" == 0 or 'now' | date: "%w" == 6 %} | |
сегодня выходной | |
{% if 'now' | date: "%H" > 10 or 'now' | date: "%H" < 21 %} | |
Если выходные время с 11 до 21, то "текст 3" | |
{% else %} | |
Если выходные и время с 21 до 11, то текст 4 | |
{% endif %} | |
{% else %} | |
сегодня будний день | |
{% if 'now' | date: "%H" > 8 or 'now' | date: "%H" < 21 %} | |
Если будни и с 9 до 21, то "текст 1" | |
{% else %} | |
если будни и с 21 до 9, то "текст 2" | |
{% endif %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment