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
What term is being referred to with "reflected-sound-of-underground-spirits"?
bldc motor, esc and battery draw, nominal vs peak
How can I practically buy stocks?
How to not starve gigantic beasts
Is the claim "Employers won't employ people with no 'social media presence'" realistic?
Why did C use the -> operator instead of reusing the . operator?
How to pronounce 'c++' in Spanish
Rivers without rain
On The Origin of Dissonant Chords
Elements other than carbon that can form many different compounds by bonding to themselves?
Alignment of various blocks in tikz
Do I have an "anti-research" personality?
How to display Aura JS Errors Lightning Out
Phrase for the opposite of "foolproof"
Does a large simulator bay have standard public address announcements?
Re-entry to Germany after vacation using blue card
If a planet has 3 moons, is it possible to have triple Full/New Moons at once?
Function pointer with named arguments?
555 timer FM transmitter
What is causing the white spot to appear in some of my pictures
Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?
Why do games have consumables?
Dynamic SOQL query relationship with field visibility for Users
A strange hotel
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;
In Magento 2's devdocs pages there is an example of
time range picker.
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
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
In Magento 2's devdocs pages there is an example of
time range picker.
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
bumped to the homepage by Community♦ 6 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
add a comment |
In Magento 2's devdocs pages there is an example of
time range picker.
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
In Magento 2's devdocs pages there is an example of
time range picker.
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
magento2 adminhtml
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♦ 6 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♦ 6 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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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();
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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();
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
add a comment |
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();
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
add a comment |
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();
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();
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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