Jump to Content
Jump to Navigation

Javascript Based Dates

Posted By Ross

We’ve made the decision to change the way dates are going to be outputted in our next version. This will solve two problems related to the current method.

Firstly, it’s in the interests of search engines. Some of you may be aware that Google has started indexing “Last Post” dates for forums. Unfortunately it’s not always getting them right as it seems to get confused with the “Joined” date from the mini-profile and even dates mentioned in the post body. The new method will help us better hide irrelevant dates from search engines and better format the important ones.

Secondly, it’s going to give you much easier control how dates are formatted. Just a couple of lines in the header would enable you to change all the formating for any date.

This functionality has been built on top of Steven Levithans Date Format class. Our version will extend it a little to allow the use of “Today” and “Yesterday”. I’m sure we’ll post a few examples of its’ usage once we’re ready to integrate it on the beta version of our software (which is the version our support forum runs).

This change will (probably) result in the “Timezone” option within profiles being removed as the dates displayed will be based on the users computer time.

As always, I’m ready to read and reply to any questions or comments you may have :)

- Ross
vForums.co.uk Staff


6 Responses to “Javascript Based Dates”

  1. Nick Says:

    Ross, this is awesome! So basically the times on the forum automatically matches your computer clock? That is awesome. Very awesome. ^_^

  2. Darkmage Says:

    That sounds great! ;D

    Can’t wait to see it! :)

  3. Canada Says:

    This is cool .

    And vforums will have an awesome v2 , with all of the great features that going to be release.

    We will no longer need the “Today and Yesterday” code ??

  4. Ross Says:

    Hi Canada,

    I’m not entirely sure which code you are referring to. But the new system would enable you to place something along these lines into your header to change all 3 versions of the last post column (for example).

    // This one is used for posts made more than 2 days ago. It’d show something like 4th May 09 at 4:56pm
    dateFormat.masks['board_last_post'] = “dS mmm yy ‘at’ h:MMtt”;

    // This one is used for posts made today. It’d show something like Today at 4:56pm
    dateFormat.masks['board_last_post_today'] = “‘‘W’‘ ‘at’ h:MMtt”;

    // This one is used for posts made yesterday. It’d show something like Yesterday at 4:56pm
    dateFormat.masks['board_last_post_yesterday'] = “W ‘at’ h:MMtt”;

    Each can have an entirely different format - including any HTML or CSS formatting you would want to add.

    - Ross

  5. Canada Says:

    Ah :D

    Cool , i get what you mean now ;D .

    Thanks Ross.

  6. Stormraven Says:

    Sounds awsome Ross >.>


Leave me your comments

Enter Your Details:

 

Enter Your Comments: