Striking new design for bootstrap 3 datepicker with a unique custom theme - stunning appearance

After purchasing a custom Metro theme from the John Papa AngularJS/Breeze courses on Pluralsight, everything was running smoothly until I attempted to integrate a Bootstrap 3 date picker into the mix. Unfortunately, right off the bat, it looked quite messy.

I noticed that the font-awesome icon was slightly smaller than the input box and the popup had inconsistent column widths, strange borders, and lacked a background, among other issues.

     <div class="col-xs-6">
         <div class="input-group">
             <input type="text" class="form-control"
                    datepicker-popup="{{vm.dateFormat}}"
                    ng-model="vm.startDate"
                    is-open="vm.openedStart"
                    max-date="{{vm.endDate | date: 'yyyy-MM-dd'}}"
                    datepicker-options="{{vm.dateOptions}}"
                    ng-required="true"
                    show-button-bar="false"
                    show-weeks="false" />
             <span class="input-group-btn">
                  <button type="button" class="btn btn-default" ng-click="vm.openStart($event)"><i class="fa fa-calendar"></i></button>
             </span>
         </div>
    </div>

It seems this issue arises whenever I attempt to use a custom bootstrap style that I've obtained, indicating that I may be missing some key understanding of how custom style sets function.

Considering I have a custom style in place, what steps should I take to reset the datepicker's style so it appears more 'default'? Clearly, I need to locate the CSS for it, and while I have a customtheme.css file, it doesn't contain much information regarding the .ui-datepicker class or provide an explanation for the lined calendar design.

Could anyone offer advice or guidance on how to resolve these issues (specifically the icon and calendar layout), or more broadly, address problems that arise when utilizing custom themes?

Answer №1

<!DOCTYPE html>
<html>
<head>
    <title>Example of Bootstrap datepicket</title>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script type='text/javascript' src='//code.jquery.com/jquery-1.8.3.js'></script>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker3.min.css">
    <script type='text/javascript' src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.min.js"></script>
<style>
.datepicker-dropdown {
  top: 0;
  left: 0;
  padding: 4px;
  background-color: #2C6E8E;
  border-radius: 10px;
}
.datepicker table {
  margin: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

}

.datepicker table tr td,
.datepicker table tr th {
  text-align: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
  color: #FFFFFF;
}

.datepicker table tr td.day:hover,
.datepicker table tr td.focused {
  background: #555555;
  cursor: pointer;
}
.datepicker table tr td.old,
.datepicker table tr td.new {
  color: #FF8000;
}

.datepicker table tr td.today {
  color: #000000;
  background-color: #FFA953;
  border-color: #FFB76F;
}
.datepicker table tr td.today:hover {
  color: #FFFFFF;
  background-color: #884400;
  border-color: #f59e00;
}
.datepicker table tr td.active:active,
.datepicker table tr td.active.highlighted:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active.highlighted.active,
.open > .dropdown-toggle.datepicker table tr td.active,
.open > .dropdown-toggle.datepicker table tr td.active.highlighted {

...

</script>
</head>
<body>
<div class="container">
<h1>Personalized datepicker</h1>
<div class="input-group date">
  <input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
</div>
</div>
</body>
</html>

Hopefully this information is useful to you, and also consider referring to this Link for additional guidance.

Answer №2

I encountered a similar issue and was able to resolve it by including the following class within dateOptions

vm.dateOptions = {
    class: 'datepicker'
};

styles

.datepicker .btn-default {
  border-width: 0;
  box-shadow: none;
}

this code snippet will eliminate the button shadow effect and remove the borders

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Limiting the number of files that can be uploaded using ng-file-upload in Angular.js is a simple process

Can someone help me with limiting file selection using ng-file-upload in Angular.js? Here is my code: <input type="file" class="filestyle form-control" data-size="lg" name="bannerimage" id="bannerimage" ng-model="file" ngf-pattern="' ...

Managing global errors and intercepting requests in AngularJS can be easily achieved by utilizing $resource interceptors and global handlers for

My question pertains to the interceptor(responseError) of $resource. It is essential to note that I am working with angularjs version V1.3.6. The Issue: app.factory('authInterceptor',['$q', '$location', '$log', fun ...

Include two arguments when making a $http POST request

I am facing a situation where a single property can have multiple images, but each image can only be assigned to that one property (one-to-many relationship with propertyId as foreign key). In the HTML, I am fetching the propertyId and passing it along wi ...

AngularJS Partial Views: Enhancing Your Website's User Experience

As a newcomer to the world of Angular, I am seeking guidance on a specific issue. I have encountered a one-to-many relationship scenario where one Category can have multiple Product items. The challenge lies in my layout page setup where I display various ...

Enhancing spacing in Bootstrap 5 with additional spacers

Looking to enhance the spacers in Bootstrap 5 by incorporating it into Sass and customizing the variables. I'm aiming to avoid redundantly defining Bootstrap's spacer options, which are as follows: $spacers: ( 0: 0, 1: $spacer * .25, 2: $s ...

Prevent the jQuery Circle Progress animation from starting at 0 when data is updated

I am utilizing the jquery-circle-progress plugin. Everything is functioning as expected. However, I have added a button to update the percentage value. <button id="add">Add</button> In the example below, when the button is clicked, ...

Having trouble with installing angular-cli

angular-cli unexpectedly quits while trying installing: (myapp)vagrant@myapp-local:/vagrant$ sudo npm install -g angular-cli npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="caadb8aba9afacbfa6e7acb98afbe4f8e4 ...

Replacing the tbody element in React with centered text using inline styles ---If you want

I am working with an empty array in React that I translate into state. When the array is empty, I want to insert a text that says "no match events yet..." into a react-bootstrap Table's tbody. In the current setup, I am struggling to center the text ...

SwipeJS experiencing technical difficulties

My Swipe.Js version : "^7.0.2" Today, I attempted to use Swipe.Js and encountered an issue with my import code. import { Swiper, SwiperSlide } from 'swiper/react'; as described on https://swiperjs.com/react#installation. However, when ...

Is jQuery the key to Masonry's stacking magic?

Hey there, I could really use some assistance with my website at this link: I thought jQuery Masonry would stack the objects closely together, but when I randomize the div boxes, there are large gaps between them. Can anyone explain why this is happening? ...

"Major issues arise as CSS3 Animation fails to function properly across all web

I have been experimenting with using a sprite and CSS3 animation to create a rollover effect. While it seems to be working in CODA 2, I'm encountering issues when testing in Mozilla, Chrome, Safari, and Opera as the animation fails to trigger. /*link ...

Creating and displaying images dynamically on a webpage using JavaScript after it has finished loading

I am trying to load images from an array and display them on a webpage upon the browser window loading. Here is my approach: const players = [ { photo: 'img/photo0.jpeg' }, { photo: 'img/photo1.jpeg' }, { ...

Is there a method to globally import "typings" in Visual Code without having to make changes to every JS file?

Is there a method to streamline the process of inputting reference paths for typings in Visual Studio Code without requiring manual typing? Perhaps by utilizing a configuration file that directs to all typings within the project, eliminating the need to ...

Having trouble with CSS messing up your gridview button display?

Oddly enough, whenever I place buttons inside a gridview, they end up looking very small (as shown in the image below), even though the gridview itself has no CSS applied to it. Is it possible that some other CSS is affecting the buttons? I have too much ...

Utilizing an array to pass a series of items to a function parameter

I am currently working on an Angular project that involves a controller and service. In this setup, the controller sends data and an endpoint to the service. As of now, the service handles the http request. However, I am in the process of refactoring my ...

Issue occurs when a circle element is not following a div element on mouse

Currently, I have implemented some jQuery code that instructs a div named small-circle to track my cursor movement. I discovered how to accomplish this by referencing a thread on stack overflow. I made slight modifications to the script to suit my specifi ...

"Interaction with jQuery causes button element to shift position upon resizing of browser

I am encountering an issue with a div element that has jQuery appended to it for a bounce effect. The element is absolutely positioned within its relative parent. However, when the browser is resized, the child element does not remain centrally aligned dur ...

What is causing the IE CSS fix to fail in Internet Explorer 8? The IE statement does not seem to end properly

Greetings! I recently attempted to implement an IE fix on my website, however, it seems that it is not effective for IE8. Should I provide more specific instructions? <!--[if IE]> <link rel="stylesheet" type="text/css" href="/AEBP_Homepage_12 ...

information not visible on the webpage

Recently, I made an alarming discovery on my website. I have implemented two different types of menus - one for the front page (designated as .navbar-inverse) and another for all other pages (.navbar-default). The front page menu is static while the other ...

How to trigger the error callback instead of success in AngularJS when making an Ajax post request

I'm relatively new to using ajax so please bear with me. When working with AngularJs, I typically execute an ajax post request like this: $.ajax({ url: "http://localhost:65337/api/Account/Register", type: ...