I got the same requirement in the past when I was working with SharePoint 2007. At that time, I achieved this requirement by developing Custom Field Type for Date Range. Believe me, it was too tricky to handle but we did not have any other option available at hand. But this time, I made use of Client Side Rendering Framework, which is a new concept introduced in SharePoint 2013.
And the awesome part about it, is that we can bring this big change without changing the existing schema of the List itself.
In order to work out the demo, we can start with an existing list " Products”, which has a list of Products available in a catalog (an arbitrary scenario), as shown below-

All we need to do is to add Product Validity information into the catalog, so that Products can be tracked based on the Product Validity Date Range.
So, let’s add a new column of type "Single Line of Text " by the name "ProductValidity " , as shown below-

Now, we need to add a new JavaScript file at any suitable location in your site. For this demo, I am adding the file to "SiteAssets" by the name "Date Range – JSLink.js" as shown below-

Now, let's add the JSLink plumbing to the JavaScript File, in the below order-
Step 1: Add required reference to JQuery Files & CSS files. For this demo, we need to add the references to "jquery-1.10.0.min.js", "jquery-ui.min.js" , and "jquery-ui.css".
- Templates: This is a sub object that can store the information regarding List Template Type.
- OnPostRender: Defines the method to be called, after the List Column gets rendered.
- Fields: Defines the field on which this JSLink should get implemented.
Step 3, Step 4 & Step 5: Define that this JSLink should be implemented on "ProductValidity" column only when it is rendered in "NewForm" and "EditForm"
Step 6: Finally, register Template Override to make sure that JSLink should get precedence over the OOB behavior of List Column rendering.

Now, let’s get inside the function "DRFieldTemplate" which will act as Template Override Handler.
Step 7: Instantiate Form Context by calling "GetFormContextForCurrentField" method.
Step 8: In this step, we are reading the "ProductValidity" Column value and splitting it by "-", since the values saved to the field as "From Date – To Date"
Step 9: In this step, we are preparing the custom HTML to render the List Field in a new way. This is the turning point of this implementation and here you can apply any HTML you like. This also equally means that we can give any desired look to our List Field in this step.
Step 10: Here, we are defining the Get Value Call Back function that supplies SharePoint a custom value for the List Column to save to.
In this step, we are getting values from two different input controls (From Date & To Date) and formatting these values by separating them using "-" character, which can be used as splitter in Step 8 above.





















Bhavik PatelPosted Jul 16, 2016, 5:24 AM
Nice
Vignesh ManiPosted Jul 15, 2016, 4:27 PM
Nice one
kalu singh raoPosted Jul 15, 2016, 3:00 PM
Nice...