2017-05-19 8 views
0

開始日と終了日を持つスプレッドシートがスプレッドシートにあります。アクティブな値の結果を表示

アクティブな従業員をその期間に表示したいが、従業員の開始日がその期間の前でない日付範囲および終了日の前にあった場所を表示するためにデータフィルタで作業することはできません。

答えて

0

var startDate = '2016-03-22'; //仮定します
var endDate = '2015-04-25'; //と仮定

var todayDate = new Date(); 
var getCurrentMonth = todayDate.getMonth().toString().length == 1 ? '0'+(todayDate.getMonth()+1) : (todayDate.getMonth()+1); 
var getCurrentDay = todayDate.getDate(); 
var getCurrentYear = todayDate.getYear(); 

var todayDate = getCurrentYear + '-' + getCurrentMonth + '-' + getCurrentDay; 
function compare(startDate, endDate) { 

    return todayDate > startDate && todayDate < endDate; 
} 

compare();