Awesome: make calendar prettier
This commit is contained in:
@@ -15,7 +15,7 @@ function for_month(month, year, formats)
|
||||
local month_last_day = os.date("*t", os.time{year = year, month = month + 1, day = 0})
|
||||
for day = 1 - (prev_month_last_day.wday % 7), month_last_day.day do
|
||||
if (day + prev_month_last_day.wday - 1) % 7 == 0 then
|
||||
text = text .. "\n " .. string.format("%.2d", week)
|
||||
text = text .. "\n " .. string.format("%.2d", week) .. " "
|
||||
week = week + 1
|
||||
end
|
||||
local day_format, day_number
|
||||
@@ -32,10 +32,10 @@ function for_month(month, year, formats)
|
||||
day_number = day
|
||||
end
|
||||
|
||||
text = text .. " " .. string.format(formats[day_format] or "%s", string.format("%2d", day_number))
|
||||
text = text .. string.format(formats[day_format] or "%s", string.format(" %2d ", day_number))
|
||||
end
|
||||
|
||||
return string.format("%.2d.%d", month_last_day.month, month_last_day.year) .. "\n" .. text
|
||||
return string.format("%13s%.2d.%d", "", month_last_day.month, month_last_day.year) .. "\n\n" .. text
|
||||
end
|
||||
|
||||
return { for_month = for_month }
|
||||
|
||||
@@ -7,10 +7,10 @@ local vicious = require('vicious')
|
||||
-- {{{ OK: Date and time
|
||||
function calendar_for_month_markup(month, year)
|
||||
local formats = {
|
||||
today = '<span color="yellow">%s</span>',
|
||||
today = '<span color="black" background="yellow">%s</span>',
|
||||
prev_month = '<span color="#aaa">%s</span>'
|
||||
}
|
||||
return '<span font_desc="fixed">' .. calendar.for_month(month, year, formats) .. '</span>'
|
||||
return '<span font_desc="monospace">' .. calendar.for_month(month, year, formats) .. '</span>'
|
||||
end
|
||||
|
||||
function create(self, format)
|
||||
|
||||
Reference in New Issue
Block a user