1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" href="assets/common.css">
- <script src="assets/common.js"></script>
- <script>
- function patch_date(f) {
- const NativeDate = window.Date;
- const date = function date(y,m,d,h,i,s,j){
- switch(arguments.length){
- case 0: return new NativeDate(date.now());
- case 1: return new NativeDate(y);
- case 2: return new NativeDate(y,m);
- case 3: return new NativeDate(y,m,d);
- case 4: return new NativeDate(y,m,d,h);
- case 5: return new NativeDate(y,m,d,h,i);
- case 6: return new NativeDate(y,m,d,h,i,s);
- case 7: return new NativeDate(y,y,m,d,h,i,s,j);
- }
- };
- date.now = NativeDate.now;
- date.UTC = NativeDate.UTC;
- return function() {
- Array.prototype.push.call(arguments, date);
- window.Date = date;
- f.apply(this, arguments);
- window.Date = NativeDate;
- };
- }
- document.addEventListener('DOMContentLoaded', function() {
- patch_date(function(Date){
- Date.now = () => {
- return new Date(2013, 2, 18).getTime();
- };
- $('input').datepicker({
- todayHighlight: true
- }).datepicker('show');
- })();
- });
- </script>
- </head>
- <body data-capture="input, .datepicker">
- <div class="row">
- <div class="col-sm-3">
- <input type="text" class="form-control" value="03/03/2013">
- </div>
- <div class="col-sm-offset-2 col-sm-3">
- <input type="text" class="form-control" value="03/18/2013">
- </div>
- </div>
- </body>
- </html>
|