Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?

More than 3 years have passed since last update.

@7kaji

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

2
Help us understand the problem. What is going on with this article?
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
2
Help us understand the problem. What is going on with this article?