Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9169149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:48:12+00:00 2026-06-17T15:48:12+00:00

How to model an end date which might not end in the near future.

  • 0

How to model an end date which might not end in the near future. I have a start (mandatory) & end date and end date can be by the user or marked as doesn’t have an end date.

  1. How do you model this, so that I can handle queries effectively. Should I leave the end date as null and introspect accordingly.
  2. How do I render such a selection for end date in the UI.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:48:13+00:00Added an answer on June 17, 2026 at 3:48 pm

    You have two choices

    1. Model the missing end-date as null
    2. Define a MAX_DATE (say 12/31/2999) that is so far in the future that it will never be reached.

    The first option “feels” more correct but makes range checking more complex. The second option makes range checking easier, but requires special handling in the UI to display it as “no end date”.

    Take your pick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Back-end: I have a model (User) that has_many of another model (ContactPreference). Front-end: An
I'm trying to make report page, on which user will choose start and end
I have Event model which contains following fields string name date start_at date end_at
I currently have a model that the user can upload a thumbnail to the
I have two fields in my model CreateDateTo CreateDateFrom which renders like this <b>Start
I have a model with a custom validation function which verifies that the date
I've created a class library which exposes my back-end object model. I don't wish
My model: class User has_many :items end class Item belongs_to :user def self.with_color(color, is_loaded)
I have a Rails 3 model D that belongs to another model, which belongs
I have a model named UserPrice which has the attribute :purchase_date (a date_select) in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.