// Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) // // MIT License (MIT) // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE // OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // Date function same_day(d1, d2) { if(d1.getFullYear()==d2.getFullYear() && d1.getMonth()==d2.getMonth() && d1.getDate()==d2.getDate())return true; else return false; } var month_list = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var month_last = {1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} var month_list_full = ['January','February','March','April','May','June','July','August','September','October','November','December']; var week_list = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var week_list_full = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; function int_to_str(i, len) { i = ''+i; if(i.length " + Math.floor( day_diff / 365 ) + " year(s) ago"; } // If jQuery is included in the page, adds a jQuery plugin to handle it as well if ( typeof jQuery != "undefined" ) jQuery.fn.prettyDate = function(){ return this.each(function(){ var date = prettyDate(this.title); if ( date ) jQuery(this).text( date ); }); }; var comment_when = prettyDate; wn.datetime.comment_when = prettyDate; // globals (deprecate) var date = dateutil = wn.datetime; var get_today = wn.datetime.get_today var only_date = wn.datetime.only_date;