Created
April 6, 2014 01:15
-
-
Save sergiopvilar/10000178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="date">{$templateconf.txtadded} {$item.DateDisplay[0]}</span> | |
<span class="year"></span> | |
<span class="day"></span> | |
<span class="month"></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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