moment.js

$('#arriving-time').on("change", function() {
	var $this = $(this);

	if($this.val() != ''){
		var after_3_months = moment().add(3, 'months');
		var selected = moment($this.val());
		if(selected.isAfter(after_3_months) == true){
			alert('抱歉,出國日期不可晚於3個月');
			$this.val('');
		}
	}
});

Difference between two moment objects:

var arr_time = moment($arr_time.val());
var dept_time = moment($dept_time.val());
//console.log(dept_time);
var gap = dept_time.diff(arr_time, 'days');
console.log(gap);

https://momentjs.com/docs/#/displaying/difference/