Browse Source

New version minus debugging

master
Andrew Chilton 12 years ago
parent
commit
c55e3e5c44
  1. 2
      jquery.datify.js
  2. 2
      jquery.datify.min.js

2
jquery.datify.js

@ -30,8 +30,6 @@
// firstly, read the date from the data attribute
var date = $this.attr('data-date').substr(0, 10);
console.log(date);
console.log($.fn.datify.pretty(date));
// set the date as a substr of what we just saw
$this.text( $.fn.datify.pretty(date) );

2
jquery.datify.min.js

@ -1 +1 @@
(function(a){a.fn.datify=function(b){a.extend({},a.fn.datify.defaults,b);return this.each(function(){var d=a(this),c=d.attr("data-date").substr(0,10);console.log(c);console.log(a.fn.datify.pretty(c));d.text(a.fn.datify.pretty(c))})};a.fn.datify.pretty=function(b){var d=b.substr(0,4),c=b.substr(5,2);b=b.substr(8,2);var e=parseInt(b),f=b%10;e+=b==11?"st":b==12?"th":f==1?"st":f==2?"nd":f==3?"rd":"th";return e=e+" "+a.fn.datify.months[c]+" "+d};a.fn.datify.months={"01":"Jan","02":"Feb","03":"Mar","04":"Apr","05":"May","06":"Jun","07":"Jul","08":"Aug","09":"Sep","10":"Oct","11":"Nov","12":"Dec"};a.fn.datify.defaults={}})(jQuery);
(function(b){b.fn.datify=function(a){b.extend({},b.fn.datify.defaults,a);return this.each(function(){var c=b(this),d=c.attr("data-date").substr(0,10);c.text(b.fn.datify.pretty(d))})};b.fn.datify.pretty=function(a){var c=a.substr(0,4),d=a.substr(5,2);a=a.substr(8,2);var e=parseInt(a),f=a%10;e+=a==11?"st":a==12?"th":f==1?"st":f==2?"nd":f==3?"rd":"th";return e=e+" "+b.fn.datify.months[d]+" "+c};b.fn.datify.months={"01":"Jan","02":"Feb","03":"Mar","04":"Apr","05":"May","06":"Jun","07":"Jul","08":"Aug","09":"Sep","10":"Oct","11":"Nov","12":"Dec"};b.fn.datify.defaults={}})(jQuery);

Loading…
Cancel
Save