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 2f841abd Method to check if membership app arrived in time
2f841abd is described below

commit 2f841abd977a77a023b299f16a0f7e8101daa2c6
Author: Sebb <s...@apache.org>
AuthorDate: Sat Mar 16 18:05:09 2024 +0000

    Method to check if membership app arrived in time
---
 lib/whimsy/asf/meeting-util.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/whimsy/asf/meeting-util.rb b/lib/whimsy/asf/meeting-util.rb
index 84a86934..b6511de6 100644
--- a/lib/whimsy/asf/meeting-util.rb
+++ b/lib/whimsy/asf/meeting-util.rb
@@ -441,11 +441,21 @@ module ASF
     end
 
     # Are membership applications still valid?
+    # Applications close date has yet to be reached
     # return: true/false
     def self.applications_valid
       self.application_time_remaining[:hoursremain] > 0
     end
 
+    # Is this particular membership application still valid?
+    # Used to check if an application was received before the close date
+    # return: true/false
+    def self.application_valid?(message_datetime)
+      expirytime = self.meeting_end + APPLICATION_EXPIRY_POST_VOTE_SECS
+      msgtime = DateTime.iso8601(message_datetime).to_time.to_i
+      msgtime <= expirytime
+    end
+
   end
 end
 

Reply via email to