How resize filed input datetime in bootstrap-datetimepicker? - html

I decided to change dashboard selected period rage datetime.
I chose bootstrap-datetimepicker.
$(function () {
$("#datetime_input").datetimepicker({
locale: 'ru'
});
$("#datetime_output").datetimepicker({
locale: 'ru'
});
});
<div class="row">
<span>C</span>
<div class='col-xs-3'>
<div class="form-group">
<div class='input-group date' id='datetime_input'>
<input id="INPUT_DATETIME" type='text' class="form-control" value="${INPUT_DATETIME}"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<span>По</span>
<div class='col-sm-3'>
<div class="form-group">
<div class='input-group date' id='datetime_output'>
<input id="OUTPUT_DATETIME" type='text' class="form-control" value="${OUTPUT_DATETIME}"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
How resize field input datetime in bootstrap-datetimepicker?
For example how reduce field input datetime?
How to eliminate the resulting difference?
p.s.
I found some question
How to resize the Bootstrap DatePicker?
Reduce size and change text color of the bootstrap-datepicker field
BUT proposed solution not work for my case.

Your question is not clear. May be you want to implement date range picker in your dashboard with bootstrap datetime picker.So, if it is like that then the below link is useful to you.
Link : http://www.daterangepicker.com/
Use the below code :
<div class="row">
<span>C</span>
<div class='col-xs-3'>
<div class="form-group">
<div class='input-group date' id='datetime_input'>
<input id="INPUT_DATETIME" type='text' class="form-control" value="${INPUT_DATETIME}"/>
<span id="input_pick" class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<span>По</span>
<div class='col-sm-3'>
<div class="form-group">
<div class='input-group date' id='datetime_output'>
<input id="OUTPUT_DATETIME" type='text' class="form-control" value="${OUTPUT_DATETIME}"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
Add CSS code :
#INPUT_DATETIME{
width : 177px;
}
#input_pick{
width: 37px;
height: 34px;
float: left;
}

Related

Input-group-addon is not intact to the input text

My input group add on is not intact to the text. Can someone help me about this?
Here is the output
here is my style.
<style>
.dates{
width: 200px !important;
margin-left: 500px;
}
</style>
here is the code for date
<div class="form-group">
<label for="title">Date</label>
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control dates" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
Correct me If I am wrong because I don't know the context exactly. Is this necessary to set input 200px wide ?
If you really want to set input width to a specific value, It must be in the container of input-group.
.form-group-wrapper {
width: 240px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="form-group-wrapper">
<div class="form-group">
<label for="title">Date</label>
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control dates" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
Otherwise I suggest you to use bootstrap grid system to make it easier like so.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
<div class="form-group">
<label for="title">Date</label>
<div class='input-group' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>

How to make radiobutton width the same for different width columns

I am having trouble making the radio button area (input-group-addon) the same size in col-sm-4 and col-sm-6 columns. I looked at some other answers where people used min-width and this solution did not work for me. I would like a uniform width for my radio button controls. Here is a visual example. My first radiobutton (input-group-addon) is wider than the second input-groups imgur link
.form-control {
width: 150px;
}
.radio-width {
width: 30px;
}
<div class="container">
<div class="form-group">
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-addon radio-width">
<span class="control-label">
<input type="radio" name="anyDate" value="anyDate">
</span>
</span>
<div class="input-group-addon">
<input type="text" class="form-control">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="input-group">
<span class="input-group-addon radio-width">
<span class="control-label">
<input type="radio" name="dateRange" value="dateRange">
</span>
</span>
<div class="input-group-addon">
<input type="text" class="form-control">
</div>
</div>
</div>
<div class="col-sm-2">
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</div>
</div>
here is the fiddle https://jsfiddle.net/DTcHh/20504/
I think you are making a bit of confusion with input-group-addon element.
An input-group-addon should be coded as follows:
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">#</span>
<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
</div>
Therefore your code should be like:
<div class="input-group">
<span class="input-group-addon"> <!-- don't need radio-width -->
<input type="radio" name="anyDate" value="anyDate">
</span>
<input type="text" class="form-control input-full">
</div>
Fiddle here.

Input-group class in bootstrap does not allow any other element on same row

Below is the code of Bootstrap which does not show properly the next element
<div class="row">
<div class="col-md-12">
<div class="col-md-2"><input type="checkbox" id="my-checkbox"/></div>
<div class="input-group date form_datetime col-md-5" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
<input class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-addon">
<span class="glyphicon glyphicon-remove"></span>
</span>
<span class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</span>
<input type="hidden" id="dtp_input1" value="" />
</div>
<div class="col-md-5">Hi</div>
</div>
</div>
I have used the suggestion given in bootstrap 3 input-group 100% width but it is not working
<div class="col-md-5">
<div class="input-group date form_datetime">
...
</div>
</div>
i have moved col-md-5 to a new parent div. please see the example

Getting two date time pickers on the same line with bootstrap 3?

I'm using eonasdan datetimepicker and bootstrap 3. I've got one datetimepicker set as calendar and the other as time. I'd like to be able to have them side by side on the same line. But I can't quite figure it out without breaking the datetimepicker. Here is my code:
<form role="form">
<div class="form-group">
<div class="form-group">
<label for="class">Class:</label> <select multiple
class="form-control" size="2">
<option value="1">Class 1</option>
<option value="2">Class 2</option>
</select>
</div>
<div class="form-group">
</div>
<div class="form-group">
<!-- Date Picker -->
<div class="input-group date" id="startDate">
<input type='text' class="form-control" /> <span
class="input-group-addon"><span
class="glyphicon glyphicon-calendar"></span> </span>
</div>
</div>
<div class="form-group">
<!-- Time Picker -->
<div class="input-group date" id="startTime">
<input type='text' class="form-control" /> <span
class="input-group-addon"><span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
And here is a JSFiddle where the date picker doesn't work but other than that OK. I also can't force the multiple select to only be 2 rows high for some reason?
This seems to be a css issue, which can be overridden. Put both datepicker and Timepicker within a div like
<div class="form-group">
<!-- Date Picker -->
<div class="input-group date " id="startDate">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
<!-- Time Picker -->
<div class="input-group date" id="startTime">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
Then use CSS:
#startDate, #startTime {
width: 50%;
float: left;
}
Note: use % value for width to keep it as responsive
JSFiddle
Could you please check. http://jsfiddle.net/6FcBT/2/
<div class="form-group">
<!-- Date Picker -->
<div class="input-group date" id="startDate">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar" />
</span>
<!-- Time Picker -->
<div class="input-group date" id="startTime">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time" />
</span>
</div>
</div>
</div><!--end form-group-->
You don't need multiple form group element. If you use one of them you can see the datepicker elements side by side.

bootstrap icons needs to be adjust in <textarea> <input type="text">

I am new to stackoverflow and bootstrap - please help me
I want to adjust two same icons parallel in an input field like in below image:
my desired result is as following:
note: the structure of HTML will be remain same
.inptRelative {
position: relative
}
.inptAbsolute {
position: absolute;
right: 5px;
top: 5px;
}
<div class="col-sm-6">
<div class="form-group-sm">
<label>Line of Business</label>
<div class="inptRelative">
<input type="text" id="myID" value="">
</div>
</div>
</div>
Please try to this code
.form-horizontal .has-feedback .form-control-feedback:last-child {
right: 35px;
}
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<form class="form-horizontal">
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
</form>
you can set width as per your need
You should use input-group.
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<form role = "form" style = "padding: 100px 100px 10px;">
<div class = "input-group">
<input type = "text" class =" form-control">
<span class = "input-group-addon glyphicon glyphicon-list"></span>
</div>
</form>