Fill filter between (min, max) field programmatically drupal I have created the view. It displays all comments from a certain time period. So I need filter created date and between option, isn't it?

But also I need to get these MIN and MAX options from node: MIN - created node time and MAX - node`s filed "to_date".

So, How can I pass these parameters to view? Is here some solution?



Edit: 

Case: I should create contest module(contest for most popular comments). 

Process: Admin creates a node of type Contest. There he must specify contest "To date" and add the description. So in order to determine contest winners, I have created view, that must sort all comments by total views and filter by range date(node created and "To date" field) from node on which page view is displaying.
I need to display this view under node: I do it in this way: 

$page['content']['winners'] = array('#markup' =&gt; views_embed_view('contest_winners_one', 'block'));


But how to change view filter for every view instance?
If the comments starting from the publication of the node are valid, you do not need a start date.  You only need to make sure you load all comments for that single node and an end date.

Since your view lists comments, I suggest you start by adding a contextual filter for the Comment: nid. This limits all the comments to those on that specific node only. For this to work in your use case, you need to update views_embed_view to also send the node id along (all parameters after the second parameter are sent as arguments (contextual filters)):

views_embed_view('contest_winners_one', 'block', $nid);


Now the results are limited to those on this node only, you need to compare the post date. If the To date is formatted properly (Drupal supports multiple date formats and out of my head I do not know the right one, but my guess is that the date needs to be stored as a timestamp), you can do a field comparison.

For this you have to add the fields to compare to the Fields section of the View (if there is no option to add fields, you can force enable in the dialog you get when clicking settings behind Format. These are the Comment: creation date and the Content: To date fields. Display format does not matter and you can select Exclude from display.

Then in the Filter section add the Field comparison filter. Then make sure the comment date is smaller or equal to the to date.

If you fail to get the contextual filter working, you can also use this approach for the content creation date and the comment creation date, but without node filtering, comments would get mixed up if two contests run at the same time.

Additionally you can probably use Rules and the Rules scheduler sub-module to disable comments on the node once the to date is reached. Refer to How do I create a rule that closes comments on node after 30 days? for reference on how to achieve this. If the comments are closed on the correct date, you can safely show all comments as they could only have been created in the defined period. (You wouldn't need any filtering)