2
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

esa にカレンダーの表をはりつける

esa は タブ区切りだと、Markdown の表形式で貼り付けてくれるので、便利ですね。
今回は、今月カレンダーを表示したいと思います。

cal.rb
require 'active_support'
require 'active_support/core_ext'

today = Date.today

print "日\t\t\t\t\t\t\n"
today.beginning_of_month.wday.times{ print "\t" }
(today.beginning_of_month..today.end_of_month).each do |day|
  print "#{day.day}"
  print "\t" unless day.saturday?
  print "\n" if day.saturday?
end
(5 - today.end_of_month.wday).times{ print "\t" }

コピ

$ ruby cal.rb |pbcopy

esa で 貼り付け

image.png

プレビュー

image.png

おー :clap:

REF

Excel等から簡単に表を貼り付けられるようになりました : https://docs.esa.io/posts/205

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
2
Help us understand the problem. What are the problem?