1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 19:39:57 +00:00
TiddlyWiki5/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.today.js
Jeremy Ruston a1c8ac624f Added first pass at support for building TiddlyWiki 2.6.x with TW5
There are still some whitespace and attribute ordering issues, but the
result runs correctly.
2012-05-29 22:02:38 +01:00

16 lines
422 B
JavaScript
Executable File

/*
jquery.tw.macro.today.js
jQuery TiddlyWiki <<today>> macro
*/
(function($) {
$.fn.tw_today = function(args) {
args.format = args.format || args[1];
var opts = $.extend({},$.fn.tw_today.defaults,args);
var now = new Date();
var text = now.formatString(opts.format.trim());
this.append("<span>"+text+"</span>");
return this;
};
$.fn.tw_today.defaults = {format:"ddd mmm 0DD 0hh:0mm:0ss YYYY"};
})(jQuery);