Skip to content

Querying current month? #3119

Closed Answered by aaronstezycki
aaronstezycki asked this question in Q&A
Discussion options

You must be logged in to vote

Rather than add this as a shortcode, I've added a utils.js in the _data folder and can now access getMonth like ...

{{ utils.getMonth() }}

// so... 

{% if utils.getMonth() == 'December' %}Do December stuff{% else %}Seasonal stuff{% endif %}

Cushty.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aaronstezycki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant