mhc 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 650db4a5196f97fe4edc81028a8eaa77be9914fbe3d3ea1c5d27b3b0fe790cbe
4
- data.tar.gz: a164d3c77a6aa6dbce5aa702158a70c9a558b6c11023dd282a14a535234ee7d7
3
+ metadata.gz: 4522630272ecdc9d44c9b994b2b31f8e36278abb0004708ec0e39d63e5d16792
4
+ data.tar.gz: cbcd079db569d336eec4eb87f21e5598cd3735b04f0fef6ffbbc8b7fdb583067
5
5
  SHA512:
6
- metadata.gz: 61edc1a0f6c05b05af51a84c9dcb40425eab9ff217f37017f8c1d9e2000c12e0c086f63fbc5a5da87e7367ceb28b5fa40657311a1d08dc0e09298f743f9629d7
7
- data.tar.gz: 7221e67e855a6658922a81482875cd92ddb6250aa89f07a671e04175a0d158a2918a68b820c04a76326aa8760fc08808515590658d4439f21c95859bc668bafe
6
+ metadata.gz: 1f052c78047e59e8638248ef56928f2ee3e85ae544b959d294c6900afb06868cb305a4a23b1ae85a35d963b870dbb0ec950c4c1d5cd9ea25d9ffe07334be5cd8
7
+ data.tar.gz: 874b007618cfd8be8a49ba0fab497ba38f6a36edfedbedf0ec72bb983c6c5ceff67a52c2b6138a62ced23fb0586e5f644eca018e2d9b963a8d79666100b94b9a
data/.gitignore CHANGED
@@ -5,7 +5,7 @@
5
5
  .bundle
6
6
  .config
7
7
  .yardoc
8
- Gemfile.lock
8
+ Gemfile.lock*
9
9
  InstalledFiles
10
10
  _yardoc
11
11
  attic/
data/bin/mhc CHANGED
@@ -120,6 +120,7 @@ class MhcCLI < Thor
120
120
  method_option :show_all, :desc => "Include all finished tasks."
121
121
 
122
122
  def todo
123
+ todos = []
123
124
  calendar.tasks.each do |task|
124
125
  if task.recurring?
125
126
  # Yearly: today - 90days .. today + 365d - 90days ?
@@ -130,9 +131,24 @@ class MhcCLI < Thor
130
131
  search_range = nil
131
132
  end
132
133
  next if task.in_category?("done") && !options[:show_all]
133
- occurrence = task.occurrences(range: search_range).first
134
- deadline = occurrence.dtstart
135
- puts format("%s %s", deadline.strftime("%Y/%m/%d %a"), task.subject)
134
+ todos << task.occurrences(range: search_range).first
135
+ end
136
+ todos.each.sort{|a, b| a.dtstart <=> b.dtstart}.each do |t|
137
+ deadline = t.dtstart
138
+ deadline_string = ""
139
+ remaining = (deadline - Mhc::PropertyValue::Date.today).to_i
140
+ if remaining == 0
141
+ deadline_string = " (due this date)"
142
+ elsif remaining > 0
143
+ deadline_string = format(" (%d days to go)", remaining)
144
+ else
145
+ deadline_string = format(" (%d days overdue)", -remaining)
146
+ end
147
+ location_string = " [#{t.location}]" if !t.location.empty?
148
+ puts format("%s %-11s %s%s%s",
149
+ deadline.strftime("%Y/%m/%d %a"),
150
+ t.time_range.to_mhc_string,
151
+ t.subject, location_string, deadline_string)
136
152
  end
137
153
  end # todo
138
154
 
data/emacs/Cask CHANGED
@@ -5,7 +5,7 @@
5
5
  (source org)
6
6
  (source melpa)
7
7
 
8
- (package "mhc" "1.2.3" "Message Harmonized Calendaring system") ;; MHC_VERSION
8
+ (package "mhc" "1.2.4" "Message Harmonized Calendaring system") ;; MHC_VERSION
9
9
 
10
10
  (files "mhc.el" "mhc-*.el")
11
11
 
@@ -411,17 +411,10 @@
411
411
  `(/ (1- (mhc-date-dd ,date)) 7))
412
412
 
413
413
  (defsubst mhc-date-cw (date)
414
- (mhc-date-let date
415
- (let* ((yday (mhc-date/day-number yy mm dd))
416
- (days (mhc-date/iso-week-days yday ww))
417
- (d))
418
- (if (< days 0)
419
- (setq days (mhc-date/iso-week-days
420
- (+ yday 365 (if (mhc-date/leap-year-p (1- yy)) 1 0)) ww))
421
- (setq d (mhc-date/iso-week-days
422
- (- yday 365 (if (mhc-date/leap-year-p yy) 1 0)) ww))
423
- (if (<= 0 d) (setq days d)))
424
- (1+ (/ days 7)))))
414
+ (string-to-number
415
+ (format-time-string
416
+ (if (= mhc-start-day-of-week 1) "%V" "%U")
417
+ (mhc-date-to-second date))))
425
418
 
426
419
  ;;
427
420
  ;; compare.
@@ -54,7 +54,7 @@
54
54
 
55
55
  (defun mhc-record-create-id ()
56
56
  "Return unique ID string."
57
- (org-id-new))
57
+ (upcase (org-id-new)))
58
58
 
59
59
  (defun mhc-record-new (name &optional id schedules sexp)
60
60
  "Constructer of MHC-RECORD structure."
@@ -356,7 +356,8 @@ message and cdr keeps a visible message."
356
356
  (or (null (setq dayinfo
357
357
  (get-text-property (point) 'mhc-dayinfo)))
358
358
  (not (eq (mhc-day-date dayinfo) date))))
359
- (goto-char (next-single-property-change (point) 'mhc-dayinfo)))))
359
+ (goto-char (or (next-single-property-change (point) 'mhc-dayinfo)
360
+ (point-min))))))
360
361
 
361
362
  (defun mhc-summary-record (&optional mailer)
362
363
  "Return record on current line."
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
  ;;; Constants:
21
- (defconst mhc-version "mhc 1.2.3") ;; MHC_VERSION
21
+ (defconst mhc-version "mhc 1.2.4") ;; MHC_VERSION
22
22
 
23
23
 
24
24
  ;;; Configration Variables:
@@ -3,7 +3,7 @@
3
3
  ;; Description: Message Harmonized Calendaring system.
4
4
  ;; Author: Yoshinari Nomura <nom@quickhack.net>
5
5
  ;; Created: 1994-07-04
6
- ;; Version: 1.2.3
6
+ ;; Version: 1.2.4
7
7
  ;; Keywords: calendar
8
8
  ;; URL: http://www.quickhack.net/mhc
9
9
  ;; Package-Requires: ((calfw "20150703"))
@@ -25,7 +25,7 @@
25
25
 
26
26
  ;;; Code:
27
27
 
28
- (eval-when-compile (require 'cl))
28
+ (eval-when-compile (require 'cl-lib))
29
29
 
30
30
  ;; For Mule 2.3
31
31
  (eval-and-compile
@@ -26,7 +26,7 @@ module Mhc
26
26
  D:propstat/D:prop/caldav:calendar-data
27
27
  ).map{|e| xmldoc.elements[e].text rescue nil}
28
28
 
29
- info.href = URI.unescape(href)
29
+ info.href = URI.decode_www_form_component(href)
30
30
  info.uid = File.basename(info.href, ".ics")
31
31
  info.status = status
32
32
  info.content_type = content_type
@@ -95,7 +95,7 @@ module Mhc
95
95
  when "COMMAND"
96
96
  possible_commands
97
97
  when "RANGE"
98
- "(today tomorrow thismonth nextmonth)"
98
+ "(all today tomorrow thismonth nextmonth)"
99
99
  when /^NUM/
100
100
  "_guard '[0-9]#' 'Number'"
101
101
  else
@@ -1,4 +1,4 @@
1
1
  module Mhc
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  PRODID = "-//Quickhack.net//MHC #{Mhc::VERSION}//EN"
4
4
  end
@@ -72,14 +72,14 @@ X-SC-Record-Id: 5E03776A-4280-4337-85C0-F1322A3AAE6E
72
72
 
73
73
  X-SC-Subject: 海の日
74
74
  X-SC-Category: Holiday Japanese
75
- X-SC-Day: !20200720 20200723
75
+ X-SC-Day: !20200720 20200723 !20210719 20210722
76
76
  X-SC-Cond: 3rd Mon Jul
77
77
  X-SC-Duration: 20030701-
78
78
  X-SC-Record-Id: BD4156C2-5546-4146-8297-09CF4210A346
79
79
 
80
80
  X-SC-Subject: 山の日
81
81
  X-SC-Category: Holiday Japanese
82
- X-SC-Day: 20200810 !20200811
82
+ X-SC-Day: 20200810 !20200811 20210808 !20210811
83
83
  X-SC-Cond: 11 Aug
84
84
  X-SC-Duration: 20160811-
85
85
  X-SC-Record-Id: FC7C481B-7BF5-4639-B700-3B60CB99E05D
@@ -110,7 +110,7 @@ X-SC-Record-Id: C17D9CA5-28AF-4826-AD33-8B75473E5B52
110
110
 
111
111
  X-SC-Subject: スポーツの日
112
112
  X-SC-Category: Holiday Japanese
113
- X-SC-Day: 20200724 !20201012
113
+ X-SC-Day: 20200724 !20201012 20210723 !20211011
114
114
  X-SC-Cond: 2nd Mon Oct
115
115
  X-SC-Duration: 20200101-
116
116
  X-SC-Record-Id: F10B2B18-B0FB-477E-A7D3-A067B31F4736
@@ -184,6 +184,7 @@ X-SC-Day: 19730430 19730924 19740506 19740916 19741104 19751124
184
184
  20081124 20090506 20100322 20120102 20120430 20121224 20130506
185
185
  20131104 20140506 20141124 20150506 20160321 20170102 20180212
186
186
  20180430 20180924 20181224 20190506 20190812 20191104 20200224 20200506
187
+ 20210809
187
188
  20230102 20240212 20240506 20240812 20240923 20241104 20250224 20250506
188
189
  20251124 20260506 20270322 20290212 20290430 20290924 20291224
189
190
  20300506 20300812 20301104 20310224 20310506 20311124 20330321 20340102
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mhc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshinari Nomura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2020-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -255,8 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubyforge_project:
259
- rubygems_version: 2.7.6
258
+ rubygems_version: 3.1.4
260
259
  signing_key:
261
260
  specification_version: 4
262
261
  summary: Message Harmonized Calendaring