Changeset 1657
- Timestamp:
- 09/14/2004 04:35:58 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/quicktags.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/quicktags.js
r1619 r1657 16 16 } 17 17 18 function zeroise(number, threshold) { 19 // FIXME: or we could use an implementation of printf in js here 20 var str = number.toString(); 21 if (number < 0) { str = str.substr(1, str.length) } 22 while (str.length < threshold) { str = "0" + str } 23 if (number < 0) { str = '-' + str } 24 return str; 25 } 26 18 27 var now = new Date(); 19 var datetime = now.getFullYear() + '-' + now.getMonth() + '-' + now.getDate() + 'T' + 20 now.getHours() + ':' + now.getMinutes() + ':' + 21 now.getSeconds() + '-' + (now.getTimezoneOffset()/60) 22 + ':' + '00'; 28 var datetime = now.getFullYear() + '-' + 29 zeroise(now.getMonth() + 1, 2) + '-' + 30 zeroise(now.getDate(), 2) + 'T' + 31 zeroise(now.getHours(), 2) + ':' + 32 zeroise(now.getMinutes(), 2) + ':' + 33 zeroise(now.getSeconds() ,2) + 34 // FIXME: we could try handling timezones like +05:30 and the like 35 zeroise((now.getTimezoneOffset()/60), 2) + ':' + '00'; 23 36 24 37 edButtons[edButtons.length] =
Note: See TracChangeset
for help on using the changeset viewer.