Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. Ext.ns('Ext.calendar');
  16. (function() {
  17. Ext.apply(Ext.calendar, {
  18. Date: {
  19. diffDays: function(start, end) {
  20. day = 1000 * 60 * 60 * 24;
  21. diff = end.clearTime(true).getTime() - start.clearTime(true).getTime();
  22. return Math.ceil(diff / day);
  23. },
  24. copyTime: function(fromDt, toDt) {
  25. var dt = toDt.clone();
  26. dt.setHours(
  27. fromDt.getHours(),
  28. fromDt.getMinutes(),
  29. fromDt.getSeconds(),
  30. fromDt.getMilliseconds());
  31. return dt;
  32. },
  33. compare: function(dt1, dt2, precise) {
  34. if (precise !== true) {
  35. dt1 = dt1.clone();
  36. dt1.setMilliseconds(0);
  37. dt2 = dt2.clone();
  38. dt2.setMilliseconds(0);
  39. }
  40. return dt2.getTime() - dt1.getTime();
  41. },
  42. // private helper fn
  43. maxOrMin: function(max) {
  44. var dt = (max ? 0: Number.MAX_VALUE),
  45. i = 0,
  46. args = arguments[1],
  47. ln = args.length;
  48. for (; i < ln; i++) {
  49. dt = Math[max ? 'max': 'min'](dt, args[i].getTime());
  50. }
  51. return new Date(dt);
  52. },
  53. max: function() {
  54. return this.maxOrMin.apply(this, [true, arguments]);
  55. },
  56. min: function() {
  57. return this.maxOrMin.apply(this, [false, arguments]);
  58. }
  59. }
  60. });
  61. })();</pre>
  62. </body>
  63. </html>