Skip to content

Instantly share code, notes, and snippets.

@sergiopvilar
Created April 6, 2014 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiopvilar/10000178 to your computer and use it in GitHub Desktop.
Save sergiopvilar/10000178 to your computer and use it in GitHub Desktop.
<span class="date">{$templateconf.txtadded} {$item.DateDisplay[0]}</span>
<span class="year"></span>
<span class="day"></span>
<span class="month"></span>
$(document).ready(function(){
// You can change for your classes or add this in your smarty template
var month = $('.month'),
day = $('.day'),
year = $('.year'),
date = $('.date').val().split('/');
var monthValue = date[0].toUpperCase(),
dayValue = date[1],
yearValue = date[2];
var months = {
'JAN': '01'
'FEB', '02',
'MAR': '03'
// etc...
};
// Hides the unecessary elements
$('.date').hide();
month.text(months[monthValue]);
day.text(dayValue);
year.text(yearValue);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment