Shortest way to print current year in a website

前端 未结 12 547
鱼传尺愫
鱼传尺愫 2020-12-07 06:45

I need to update a few hundred static HTML pages that have the copyright date hard coded in the footer. I want to replace it with some JavaScript that will automatically upd

12条回答
  •  无人及你
    2020-12-07 07:31

    For React.js, the following is what worked for me in the footer...

    render() {
        const yearNow = new Date().getFullYear();
        return (
        
    © Company 2015-{yearNow}
    ); }

提交回复
热议问题