年-月-日 (曜日)
曜日付き年月日を挿入

Script key: 曜日付き年月日を挿入

Posted by @goonfoot

Install

Details

Label 年-月-日 (曜日)
Voice Over 曜日付き年月日を挿入
Script
var now = new Date();
var dd = now.getDate();
var mm = now.getMonth()+1;
var yyyy = now.getFullYear();
var day = now.getDay();

if(dd < 10) {
  dd = '0' + dd;
} 

if(mm < 10) {
  mm = '0' + mm;
} 

switch (day) {
  case 0:
    var jday = '日';
    break;
  case 1:
    var jday = '月';
    break;
  case 2:
    var jday = '火';
    break;
  case 3:
    var jday = '水';
    break;
  case 4:
    var jday = '木';
    break;
  case 5:
    var jday = '金';
    break;
  case 6:
    var jday = '土';
    break;
}

var today = yyyy + '-' + mm + '-' + dd + ' (' + jday + ')';
var selRange = getSelectedRange();
setSelectedText(today);
setSelectedRange(selRange[0]+today.length, 0);

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus