How to add time range picker to adminhtml form in Magento 2?Magento 2 Show timepicker using UiComponent not...

What are the characteristics of a typeless programming language?

Elements other than carbon that can form many different compounds by bonding to themselves?

What does ゆーか mean?

a sore throat vs a strep throat vs strep throat

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

How exactly does Hawking radiation decrease the mass of black holes?

How to display Aura JS Errors Lightning Out

Betweenness centrality formula

What is the philosophical significance of speech acts/implicature?

Extension of 2-adic valuation to the real numbers

Could the terminal length of components like resistors be reduced?

Does a large simulator bay have standard public address announcements?

"The cow" OR "a cow" OR "cows" in this context

Apply MapThread to all but one variable

"You've called the wrong number" or "You called the wrong number"

Map of water taps to fill bottles

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

Pulling the rope with one hand is as heavy as with two hands?

Why does Mind Blank stop the Feeblemind spell?

Was there a Viking Exchange as well as a Columbian one?

Re-entry to Germany after vacation using blue card

How can I practically buy stocks?

Get consecutive integer number ranges from list of int

Check if a string is entirely made of the same substring



How to add time range picker to adminhtml form in Magento 2?


Magento 2 Show timepicker using UiComponent not DatepickerModel _beforeSave observer can't save timeMagento 2 Pattern Library — Date & Time SelectorsHow to include custom javascript to admihtml edit form in Magento 2?Magento 2 : How to add additional fields to newsletterMagento 2.1 - Add category selector field in backend custom model formMagento2 : how to create admin page with configuration fieldsMagento 2: How to add a Color Picker in Grid?Date Time picker and time zone woesMagento 2.1.11 - adminhtml - Saving model to database with boolean field does not match valueCan't get a time field value in admin form






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







10















In Magento 2's devdocs pages there is an example of
time range picker.
enter image description here
But ,i can not find any examples of how to add it in my backend form for creating/editing of custom model.
Have anyone any idea of how to do this?



Also ,i have a question on how to save it in mysql database. Do this picker needs 2 fields ("from" and "to") to store entered time?










share|improve this question
















bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Here is a link to how to add uiComponents devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/… It is along same lines, create the attributes to save in db, create the xml to display.

    – djfordz
    Dec 17 '18 at 12:57











  • @jurgen did you ever find a solution for this one?

    – magefms
    Apr 12 at 3:17











  • No, I no longer work with Magento2

    – jurgen
    Apr 18 at 19:13


















10















In Magento 2's devdocs pages there is an example of
time range picker.
enter image description here
But ,i can not find any examples of how to add it in my backend form for creating/editing of custom model.
Have anyone any idea of how to do this?



Also ,i have a question on how to save it in mysql database. Do this picker needs 2 fields ("from" and "to") to store entered time?










share|improve this question
















bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Here is a link to how to add uiComponents devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/… It is along same lines, create the attributes to save in db, create the xml to display.

    – djfordz
    Dec 17 '18 at 12:57











  • @jurgen did you ever find a solution for this one?

    – magefms
    Apr 12 at 3:17











  • No, I no longer work with Magento2

    – jurgen
    Apr 18 at 19:13














10












10








10


3






In Magento 2's devdocs pages there is an example of
time range picker.
enter image description here
But ,i can not find any examples of how to add it in my backend form for creating/editing of custom model.
Have anyone any idea of how to do this?



Also ,i have a question on how to save it in mysql database. Do this picker needs 2 fields ("from" and "to") to store entered time?










share|improve this question
















In Magento 2's devdocs pages there is an example of
time range picker.
enter image description here
But ,i can not find any examples of how to add it in my backend form for creating/editing of custom model.
Have anyone any idea of how to do this?



Also ,i have a question on how to save it in mysql database. Do this picker needs 2 fields ("from" and "to") to store entered time?







magento2 adminhtml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 5 '16 at 9:32









Amit Bera

60.3k1678178




60.3k1678178










asked May 5 '16 at 7:39









jurgenjurgen

180112




180112





bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Here is a link to how to add uiComponents devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/… It is along same lines, create the attributes to save in db, create the xml to display.

    – djfordz
    Dec 17 '18 at 12:57











  • @jurgen did you ever find a solution for this one?

    – magefms
    Apr 12 at 3:17











  • No, I no longer work with Magento2

    – jurgen
    Apr 18 at 19:13



















  • Here is a link to how to add uiComponents devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/… It is along same lines, create the attributes to save in db, create the xml to display.

    – djfordz
    Dec 17 '18 at 12:57











  • @jurgen did you ever find a solution for this one?

    – magefms
    Apr 12 at 3:17











  • No, I no longer work with Magento2

    – jurgen
    Apr 18 at 19:13

















Here is a link to how to add uiComponents devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/… It is along same lines, create the attributes to save in db, create the xml to display.

– djfordz
Dec 17 '18 at 12:57





Here is a link to how to add uiComponents devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/… It is along same lines, create the attributes to save in db, create the xml to display.

– djfordz
Dec 17 '18 at 12:57













@jurgen did you ever find a solution for this one?

– magefms
Apr 12 at 3:17





@jurgen did you ever find a solution for this one?

– magefms
Apr 12 at 3:17













No, I no longer work with Magento2

– jurgen
Apr 18 at 19:13





No, I no longer work with Magento2

– jurgen
Apr 18 at 19:13










1 Answer
1






active

oldest

votes


















0














Try this,



Under appcodeNamespaceModuleBlockAdminhtmlCustomEditForm.php



$fieldset->addField(
'from',
'time',
[
'name' => 'from',
'label' => __('From'),
'title' => __('From'),
'required' => true,
'note' => __('From Timer')
]
);

$fieldset->addField(
'to',
'time',
[
'name' => 'to',
'label' => __('To'),
'title' => __('To'),
'required' => true,
'note' => __('To Timer')
]
);


Create the field in database to save the to and from values.



In controller file,



public function saveData()
{
$data = $this->getRequest()->getPostValue();
$model = $this->_objectManager->create('NamespaceModuleModelCustom');
$model->setData($data);
$model->save();
}





share|improve this answer


























  • I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

    – jurgen
    Jun 8 '16 at 6:33














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f114043%2fhow-to-add-time-range-picker-to-adminhtml-form-in-magento-2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try this,



Under appcodeNamespaceModuleBlockAdminhtmlCustomEditForm.php



$fieldset->addField(
'from',
'time',
[
'name' => 'from',
'label' => __('From'),
'title' => __('From'),
'required' => true,
'note' => __('From Timer')
]
);

$fieldset->addField(
'to',
'time',
[
'name' => 'to',
'label' => __('To'),
'title' => __('To'),
'required' => true,
'note' => __('To Timer')
]
);


Create the field in database to save the to and from values.



In controller file,



public function saveData()
{
$data = $this->getRequest()->getPostValue();
$model = $this->_objectManager->create('NamespaceModuleModelCustom');
$model->setData($data);
$model->save();
}





share|improve this answer


























  • I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

    – jurgen
    Jun 8 '16 at 6:33


















0














Try this,



Under appcodeNamespaceModuleBlockAdminhtmlCustomEditForm.php



$fieldset->addField(
'from',
'time',
[
'name' => 'from',
'label' => __('From'),
'title' => __('From'),
'required' => true,
'note' => __('From Timer')
]
);

$fieldset->addField(
'to',
'time',
[
'name' => 'to',
'label' => __('To'),
'title' => __('To'),
'required' => true,
'note' => __('To Timer')
]
);


Create the field in database to save the to and from values.



In controller file,



public function saveData()
{
$data = $this->getRequest()->getPostValue();
$model = $this->_objectManager->create('NamespaceModuleModelCustom');
$model->setData($data);
$model->save();
}





share|improve this answer


























  • I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

    – jurgen
    Jun 8 '16 at 6:33
















0












0








0







Try this,



Under appcodeNamespaceModuleBlockAdminhtmlCustomEditForm.php



$fieldset->addField(
'from',
'time',
[
'name' => 'from',
'label' => __('From'),
'title' => __('From'),
'required' => true,
'note' => __('From Timer')
]
);

$fieldset->addField(
'to',
'time',
[
'name' => 'to',
'label' => __('To'),
'title' => __('To'),
'required' => true,
'note' => __('To Timer')
]
);


Create the field in database to save the to and from values.



In controller file,



public function saveData()
{
$data = $this->getRequest()->getPostValue();
$model = $this->_objectManager->create('NamespaceModuleModelCustom');
$model->setData($data);
$model->save();
}





share|improve this answer















Try this,



Under appcodeNamespaceModuleBlockAdminhtmlCustomEditForm.php



$fieldset->addField(
'from',
'time',
[
'name' => 'from',
'label' => __('From'),
'title' => __('From'),
'required' => true,
'note' => __('From Timer')
]
);

$fieldset->addField(
'to',
'time',
[
'name' => 'to',
'label' => __('To'),
'title' => __('To'),
'required' => true,
'note' => __('To Timer')
]
);


Create the field in database to save the to and from values.



In controller file,



public function saveData()
{
$data = $this->getRequest()->getPostValue();
$model = $this->_objectManager->create('NamespaceModuleModelCustom');
$model->setData($data);
$model->save();
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 6 '16 at 11:44

























answered Jun 6 '16 at 11:21









saravanavelusaravanavelu

3,05562245




3,05562245













  • I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

    – jurgen
    Jun 8 '16 at 6:33





















  • I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

    – jurgen
    Jun 8 '16 at 6:33



















I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

– jurgen
Jun 8 '16 at 6:33







I've tried this earlier. This code adds two time fields positioned vertically. If I need 7 time range pickers (for each day of week) it looks very cumbersome. I wanted to place it at least in one line but much desirable to have it exact as on picture above. My opinion is that this time range picker exists only in Magento 2 design patterns and does not have implementation yet. For now I made it using single text field and Bootstrap Date Range Picker, customized it to show only time range. Result I save in DB in text format ("10:00-15:00" for example) which suits for my tasks.

– jurgen
Jun 8 '16 at 6:33




















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f114043%2fhow-to-add-time-range-picker-to-adminhtml-form-in-magento-2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

“%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...