Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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

7kaji
Scrap & Scrap
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした