Subversion Repositories SmartDukaan

Rev

Rev 23884 | Rev 23892 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23884 Rev 23886
Line 284... Line 284...
284
	    lastThree = ',' + lastThree;
284
	    lastThree = ',' + lastThree;
285
	return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
285
	return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
286
}
286
}
287
 
287
 
288
function dateRangeCallback(start, end) {
288
function dateRangeCallback(start, end) {
289
	startDate = start.toJSON();
289
	startMoment = start;
290
	endDate = end.toJSON();
290
	endMoment = end;
-
 
291
	startDate = start.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);
-
 
292
	endDate = end.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);
291
}
293
}
292
 
294
 
293
function getSingleDatePicker(){
295
function getSingleDatePicker(){
294
	var singleDatePicker =  
296
	var singleDatePicker =  
295
	{ 
297
	{ 
296
		"todayHighlight": true, 
298
		"todayHighlight": true, 
297
		"startDate": moment(),
299
		"startDate": startMoment || moment(),
298
		"maxDate":  moment(),
-
 
299
		"autoclose": true,
300
		"autoclose": true,
300
		"autoUpdateInput": true,
301
		"autoUpdateInput": true,
301
		"singleDatePicker": true,
302
		"singleDatePicker": true,
302
    "locale": {
303
    "locale": {
303
		'format': 'DD/MM/YYYY'
304
		'format': 'DD/MM/YYYY'
304
	}
305
	}
305
  };
306
  };
306
	return singleDatePicker;
307
	return singleDatePicker;
-
 
308
}
-
 
309
 
-
 
310
function getRangedDatePicker(showRanges){
-
 
311
	if(typeof showRanges=="undefined") {
-
 
312
		showRanges = false;
-
 
313
	}
-
 
314
	var rangedDatePicker =  
-
 
315
	{ 
-
 
316
			"todayHighlight": true,
-
 
317
			"opens": "left",
-
 
318
			"startDate": startMoment || moment(),
-
 
319
			"endDate": endMoment || moment(),
-
 
320
			"autoclose": true,
-
 
321
			"alwaysShowCalendars": false,
-
 
322
			"autoUpdateInput": true,
-
 
323
			"locale": {
-
 
324
				'format': 'DD/MM/YYYY'
-
 
325
			}
-
 
326
	};
-
 
327
	if(showRanges) {
-
 
328
		rangedDatePicker['ranges'] = 
-
 
329
		{
-
 
330
            'Today': [moment(), moment()],
-
 
331
            'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
-
 
332
            'Last 7 Days': [moment().subtract(6, 'days'), moment()],
-
 
333
            'Last 30 Days': [moment().subtract(29, 'days'), moment()],
-
 
334
            'This Month': [moment().startOf('month'), moment().endOf('month')],
-
 
335
            'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
-
 
336
         }
-
 
337
	}
-
 
338
	return rangedDatePicker;
307
}
339
}
308
340