Body: <p><strong>Current Behavior: &quot;Exclusive&quot; Expiration Dates</strong></p>
  <p>When creating or editing a membership, CiviMember automatically sets the <code>Membership Expiration Date</code> based on the <code>Duration</code> specified in the <code>Membership Type</code> if the Membership Expiration Date field is not manually set.</p>
  <p>When adding a new membership with a starting date of <strong>January 1st</strong>...</p>
  <p><a href="https://i.sstatic.net/J8s0CH2C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/J8s0CH2C.png" alt="enter image description here" /></a></p>
  <p>...with the Student Membership valid for <strong>1 year</strong>...</p>
  <p><a href="https://i.sstatic.net/4h7hIHnL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4h7hIHnL.png" alt="enter image description here" /></a></p>
  <p>...CiviMember automatically sets the expiration date to <strong>December 31st</strong>.</p>
  <p><a href="https://i.sstatic.net/JIwMLq2C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JIwMLq2C.png" alt="enter image description here" /></a></p>
  <p><strong>Desired Behavior: &quot;Inclusive&quot; Expiration Dates</strong></p>
  <p>Using the example above, how can I get CiviMember to automatically set the <code>Membership Expiration Date</code> to <strong>January 1, 2025</strong> for a 1-year membership starting on January 1, 2024?</p>
  <p>I don't see any configuration option in the UI to enable this.</p>
  <p>Should I be looking to code this in a custom extension using <a href="https://docs.civicrm.org/dev/en/latest/hooks/list/#membership-hooks" rel="nofollow noreferrer">hooks</a>?</p>
  <p>This would apply to membership types with a <code>Membership Type Duration Unit</code> of either <code>month</code> or <code>year</code>, essentially adding +1 day to the current date calculation.</p>
  <p>It could also apply to memberships of <code>day</code> duration, but we don't use those anyway. It wouldn't apply to <code>lifetime</code> memberships.</p>
  <p><a href="https://i.sstatic.net/9Q8iJFNK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9Q8iJFNK.png" alt="enter image description here" /></a></p>
  <p>Appreciate any ideas!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-18T20:53:56.173Z
Comments.Text: leap years would trip this up but would setting the Duration to 366 days address your issue?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-18T22:23:28.327Z
Comments.Text: Good idea, Pete. If it was just 1-year durations, that might work. But it won't really be feasible with the variety of membership durations we have: 1 year, 1.5 years, 2 years.
Comments.UserDisplayName: Justin657
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-19T02:18:23.293Z
Comments.Text: ok. never heard a similar request for a 'year' to be 'a year plus a day'. i assume you will need a custom extension tht will jump in and add one day to a membership. possible civirules could be another route to take
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-19T09:33:40.437Z
Comments.Text: Yeah, 366 days won't work as if they renew on 1st on Jan 2025 they will get end date to 2nd Jan 2025. You will need to add custom code to do this
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-19T17:30:27.737Z
Comments.Text: Thanks for the feedback. I tried CiviRules but there are currently no actions to control the membership expiration date. Looks like a custom extension is the way to go.
Comments.UserDisplayName: Justin657
Tags: <civimember><dates>
Title: Membership Expiration Dates: How to set the date to be inclusive instead of exclusive?
ThreadText: # Membership Expiration Dates: How to set the date to be inclusive instead of exclusive?
  
  (Asked by: username_0 on 2024-06-18)
  
  **Current Behavior: "Exclusive" Expiration Dates**
  
  When creating or editing a membership, CiviMember automatically sets the `Membership Expiration Date` based on the `Duration` specified in the `Membership Type` if the Membership Expiration Date field is not manually set.
  
  When adding a new membership with a starting date of **January 1st**...
  
  [![enter image description here](https://i.sstatic.net/J8s0CH2C.png)](https://i.sstatic.net/J8s0CH2C.png)
  
  ...with the Student Membership valid for **1 year**...
  
  [![enter image description here](https://i.sstatic.net/4h7hIHnL.png)](https://i.sstatic.net/4h7hIHnL.png)
  
  ...CiviMember automatically sets the expiration date to **December 31st**.
  
  [![enter image description here](https://i.sstatic.net/JIwMLq2C.png)](https://i.sstatic.net/JIwMLq2C.png)
  
  **Desired Behavior: "Inclusive" Expiration Dates**
  
  Using the example above, how can I get CiviMember to automatically set the `Membership Expiration Date` to **January 1, 2025** for a 1-year membership starting on January 1, 2024?
  
  I don't see any configuration option in the UI to enable this.
  
  Should I be looking to code this in a custom extension using [hooks](https://docs.civicrm.org/dev/en/latest/hooks/list/#membership-hooks)?
  
  This would apply to membership types with a `Membership Type Duration Unit` of either `month` or `year`, essentially adding +1 day to the current date calculation.
  
  It could also apply to memberships of `day` duration, but we don't use those anyway. It wouldn't apply to `lifetime` memberships.
  
  [![enter image description here](https://i.sstatic.net/9Q8iJFNK.png)](https://i.sstatic.net/9Q8iJFNK.png)
  
  Appreciate any ideas!
  
  **Tags:** civimember, dates
  
  > **Comments:**
  > **username_1**: leap years would trip this up but would setting the Duration to 366 days address your issue?  
  > **username_0**: Good idea, Pete. If it was just 1-year durations, that might work. But it won't really be feasible with the variety of membership durations we have: 1 year, 1.5 years, 2 years.  
  > **username_1**: ok. never heard a similar request for a 'year' to be 'a year plus a day'. i assume you will need a custom extension tht will jump in and add one day to a membership. possible civirules could be another route to take  
  > **username_2**: Yeah, 366 days won't work as if they renew on 1st on Jan 2025 they will get end date to 2nd Jan 2025. You will need to add custom code to do this  
  > **username_0**: Thanks for the feedback. I tried CiviRules but there are currently no actions to control the membership expiration date. Looks like a custom extension is the way to go.  
  
  ---
  
  ## 0 answers
  
  