skip to Main Content

i am using twitter’s bootstrap and its glyphicon for the copyright mark on our page footer.
i would like to add the current year to it and i dont want to hardcode it.
i have tried to look around in the official documentation here , but could not really find anything.

what is the best way to achieve this using bootstrap? or is bootstrap not really meant to be used for this and its a complete javascript thing? (i am JS nube)

2

Answers


  1. Why do you need custom font icon for something available already in your standard character set? ©©©©

    http://www.fileformat.info/info/unicode/char/a9/index.htm

    © // ©
    

    Current year could be added with JS or server-side code. For example in JS use:

    new Date().getFullYear()
    
    Login or Signup to reply.
  2. If this is a pure HTML site, then you can do something like the following:

    HTML:

    <footer id="pagefooter">
       <p id="copyright"></p>
    </footer>
    

    JavaScript:

    function copyrightYear() {
       var d = new Date();
       var y = d.getFullYear();
       document.getElementById("copyright").innerHTML = 'Copyright &copy; ' + y + ' Your Name Here';
    }
    
    copyrightYear();
    

    As was noted in the other answer, you really do not need Bootstrap’s icon in order to get the copyright symbol. It is built into HTML with the &copy; code and will use the same typeface as the element that contains it, in this case a paragraph tag.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search