LoginSignup
9
2

More than 5 years have passed since last update.

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

Posted at

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

9
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
2