Drupal 7 – resizing the content area based on publish date

I was asked to look at a site where the content created before Jan. 15th 2013 was crafted to display nicely in a 600px wide area.
New content is being added with a much wider area and with some thought given to the possibility of a fluid width (potentially responsive).

So while setting a fixed width isn’t ideal I came up with a proof of concept that demonstrated the possibility using jQuery to resize the content area on page load.
The content in question has two key elements to identify for jQuery:

  1. The publish date:
    $('.field-name-field-publish-date .date-display-single')
  2. The content area:
    $('.field-name-body')

Here’s a sample of the code that could re-format the older content based on the published date:

$('.field-name-field-publish-date .date-display-single').length
//if( (currentContentDate < narrowContentCutOffDate)) {
if ( ( new Date($('.field-name-field-publish-date .date-display-single').text()).getTime() < new Date('January 15, 2013').getTime() ) ) {
        $('.field-name-body').css('width','600px');
}//end if
&#91;/code&#93;

Wrapped in a Drupal.behaviors function it could be added to the site in a js file like so, to run once on each page load:
<span id="more-2960"></span>
<div class="tallcode">
(function ($) {
  Drupal.behaviors.fixOldContentWidth = {
    attach: function(context) {
      if(typeof context !== 'undefined'){ //run only if there is a context var
        if(typeof context == 'object' && context.toString().indexOf('HTMLDocument')!=-1){ //Page Load
          if ( jQuery('.field-name-field-publish-date .date-display-single').length > 0 ) { //if the field exists
            //if( (currentContentDate < narrowContentCutOffDate)) {
            if ( ( new Date($('.field-name-field-publish-date .date-display-single').text()).getTime() < new Date('January 15, 2013').getTime() ) ) {
              $('.field-name-body').css('width','600px');
            }//end if( (currentContentDate < narrowContentCutOffDate))
          }//end if ( jQuery('.field-name-field-publish-date .date-display-single').length > 0 )
        }//end if(typeof context == 'object' && context.toString().indexOf('HTMLDocument')!=-1){ //Page Load
      }//end typeof context !== und
    }//end function(context)
  }//end Drupal.behaviors
})(jQuery);

I tested it on several pages and seems to do the trick.