This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 47b0a2ba Allow for empty date fields
47b0a2ba is described below
commit 47b0a2ba69adb9c5659c941e8a558af0c80a0a43
Author: Sebb <[email protected]>
AuthorDate: Tue Aug 15 23:50:17 2023 +0100
Allow for empty date fields
---
lib/whimsy/asf/podling.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/whimsy/asf/podling.rb b/lib/whimsy/asf/podling.rb
index 4bf90ffc..56cba388 100644
--- a/lib/whimsy/asf/podling.rb
+++ b/lib/whimsy/asf/podling.rb
@@ -117,9 +117,9 @@ module ASF
# date this podling was accepted for incubation
def startdate
- return unless @startdate
+ return unless @startdate and @startdate.length >= 7 # "YYYY-MM"
# assume 15th (mid-month) if no day specified
- return Date.parse("#{@startdate}-15") if @startdate.length < 8
+ return Date.parse("#{@startdate}-15") if @startdate.length == 7
Date.parse(@startdate)
rescue ArgumentError
nil
@@ -128,9 +128,9 @@ module ASF
# date this podling either retired or graduated. <tt>nil</tt> for
# current podlings.
def enddate
- return unless @enddate
+ return unless @enddate and @enddate.length >= 7
# assume 15th (mid-month) if no day specified
- return Date.parse("#{@enddate}-15") if @enddate.length < 8
+ return Date.parse("#{@enddate}-15") if @enddate.length == 7
Date.parse(@enddate)
rescue ArgumentError
nil