Skip to content

Method to get current year? #763

Answered by michellaurent
ecupaio asked this question in Q&A
Discussion options

You must be logged in to vote

I think that you can use a function for that.

In config.js:

current_year: function() {
    return new Date().getFullYear()
}

In your template:

<p>{{ page.current_year }}</p>

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@cossssmin
Comment options

@ecupaio
Comment options

@michellaurent
Comment options

@cossssmin
Comment options

@ecupaio
Comment options

Answer selected by ecupaio
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@ecupaio
Comment options

@michellaurent
Comment options

@ecupaio
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants