Docs    Facebook    Customizations

Add dates to Photo, Video, and Album feeds

You can use this snippet to add dates below the posts in your Photo, Album, and Video grid feeds.

Photo Feeds

Add the following to the plugin’s “Custom JavaScript” section, which can be found under Customize > Misc in the settings:

function cffTimeConverter(UNIX_timestamp){
  var a = new Date(UNIX_timestamp * 1000);
  var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
  var year = a.getFullYear();
  var month = months[a.getMonth()];
  var date = a.getDate();
  var time = date + ' ' + month + ', ' + year;
  return time;
}
$('.cff-album-item').each(function(){
  var timeStamp = $(this).attr('data-cff-timestamp');
  if( $(this).find('.cff-photo-date').length < 1 ) $(this).append( '<p class="cff-photo-date">' + cffTimeConverter(timeStamp) + '</p>' );
});

Album and Video Feeds

Use the following snippet instead to add dates to Album or Video feeds:

function cffTimeConverter(UNIX_timestamp){
  var a = new Date(UNIX_timestamp * 1000);
  var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
  var year = a.getFullYear();
  var month = months[a.getMonth()];
  var date = a.getDate();
  var time = date + ' ' + month + ', ' + year;
  return time;
}
$('.cff-album-item').each(function(){
  var timeStamp = $(this).attr('data-cff-timestamp');
  if( $(this).find('.cff-photo-date').length < 1 ) $(this).find('.cff-album-info').append( '<p class="cff-photo-date">' + cffTimeConverter(timeStamp) + '</p>' );
});

Technical Support

Still have questions? We are here to help you succeed.

Open a support ticket