Deactivate specific dates in angular-strap 2.0

With the use of angular-strap v0.7, I successfully utilized Bootstrap's beforeShowDay method to enable/disable specific dates in the datepicker.

However, in angular-strap 2.0, I am struggling to locate this feature. Is it available in this version?

I am currently working on a payment system that allows users to schedule payments for upcoming dates. The requirement is to only permit selection of valid business days. To achieve this, an API call returns a list of valid dates excluding weekends and federal holidays. My goal is to restrict users from choosing these weekend and holiday dates.

Answer №1

After reviewing the angular-strap repository on https://github.com/mgcrea/angular-strap, it was observed that a recent commit had been made less than 24 hours before the question was asked to introduce a new functionality. This feature is not yet part of the v2.0.3 release, indicating that it may be included in a future update like v2.0.4.

To restrict certain date ranges, users can provide an array to the directive using the disabled-dates attribute. The array should contain objects formatted as {start: new Date(2014, 03, 03), end: new Date(2014, 03, 05)} to specify which dates to disable.

Note that this attribute does not support two-way binding. Any modifications to the array after compilation and linking will not be reflected in the directive.

For further details, refer to the commit message on https://github.com/mgcrea/angular-strap/commit/bb5038064a681842539984d5626ea550ff3c4c8e. Once this feature is officially released, documentation updates are expected at .

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

How is it that connecting an event listener to a React child component can be done in a way that resembles simply passing a prop

class Board extends React.Component { constructor(props) { super(props); this.state = { squares: Array(9).fill(null), }; } handleClick(i) { // do things } render() { return ( <div ...

performing a query on two tables with sequelize

There must be a more efficient way to accomplish this task with fewer lines of code. I am not very experienced with databases and I am new to sequelize and node. The user id is passed as a parameter and I need to check if there is a corresponding user in ...

Problem with CSS: In Chrome, text fields have 3px additional margin-right

https://i.sstatic.net/I8mzi.jpg I am facing an issue with the margins of my text fields. Even though I have set a margin-right of 5px for each field, Google Chrome seems to be adding an additional 3-4px automatically. This problem is evident when I dynami ...

Refine current attributes of an object in Typescript

In typescript, I have an object of type any that needs to be reshaped to align with a specific interface. I am looking for a solution to create a new object that removes any properties not defined in the interface and adds any missing properties. An exam ...

JavaScript code: "Retrieve the div element and append metadata to the HTML file

Currently, I am utilizing the subsequent technique to save a target tag on my webpage as an HTML file. function retrieveHtml(filename, elId, format) { var htmlEl = document.getElementById(elId).innerHTML; if (navigator.msSaveBlob) { // IE 10+ ...

Having trouble sorting data-text values that include colspan cells

Latest Update: Encountered an issue with incorrect sorting and frozen sortings when dealing with a cell containing the colspan attribute. Refer to https://jsfiddle.net/2zhjsn31/12/ where the problem arises for the date 2018-06-24 On https://jsfiddle.n ...

Toggle between hiding and showing div elements issue

Currently in the final stages of developing an iPhone web app, I have encountered a small issue that needs to be resolved. I have successfully hidden one layer and displayed another with a button click. However, what I am aiming for is to toggle between s ...

Unable to sort array within a computed property in Vue.JS

Currently, I am working on enhancing my skills in Vue.js and have encountered an issue with sorting arrays in Vue.js. Despite using the sort(a-b) method for ascending order (least alphabet/value first), the array remains unchanged. Even with a function ins ...

Socket.io crashes when refreshed repeatedly

I have set up a socket.io connection to a secure https server to receive data from JavaScript. Upon refreshing the page, I noticed that the socket is maintaining the connection - confirming this when I log information in the on('connection', func ...

Choose the initial offspring from a shared category and assign a specific class identifier

I am trying to figure out how to apply the "active" class to the first tab-pane within each tab-content section in my HTML code. Here is an example of what I'm working with: <div class="tab-content"> <div class='tab-pane'>< ...

Retrieving information from a text document by means of data-src with the assistance of jQuery

Trying to extract text from a .txt file using jQuery while utilizing Bootstrap. New to web design with some coding experience. Button in HTML: <button type="button" class="btn btn-primary-outline-btn text-btn" data-toggle="modal ...

PHP not receiving values when making an AJAX POST request

My AJAX file below is where I pass all the values from my text boxes and post them to edu.php. In edu.php, I intend to update two tables - details and test. However, nothing seems to be updating in my database. When I checked the values with var_dump, the ...

Give an npm package a nickname using a browserify shim

I'm in the process of transitioning from requirejs to browserify. One of the dependencies I have is for masonry. Trying to shim it using the bower version was proving to be a little challenging (more on that can be found here). Instead, I decided t ...

Is there a way to restrict access to my website to only be opened in the Chrome browser?

Is there a way to prevent my web application from loading when the link is opened in browsers other than Chrome? Can this be achieved using Javascript or Java? I want to restrict the usage of my web application to only Chrome. Any assistance would be appre ...

Creating TypeScript declarations for standard JavaScript functions and objects so they can be accessed in a TypeScript project

In my TS project, I am currently using Node, Express, and Handlebars along with some client-side JS successfully. I don't have any other client-side frameworks like React or Angular integrated at this time. Recently, I have been thinking about conver ...

Monitoring the initiation and completion of web requests within the Ionic framework

Currently utilizing the ionic framework in conjunction with Angular JS. In need of assistance on how to monitor the initiation of a web request. To handle the completion of a request, I have created a directive with an onLoad attribute. Here is the exam ...

Develop a responsive image component with flexible dimensions in React

I am currently working on developing a dynamic image component that utilizes the material-ui CardMedia and is configured to accept specific height and width parameters. The code snippet I have is as follows: interface ImageDim extends StyledProps { wid ...

How can I prevent an Angular filter from duplicating an array

Encountering an issue with my Angular code. Attempting to filter an array using the Angular filter service, but instead of selecting each element in the array, it duplicates. I have experimented with 'track by' but it does not resolve the proble ...

Updating or editing data in a database using AngularJS: A step-by-step guide

Recently, while working on a web application, I included the following update code but it seems to not be functioning as intended. To provide an overview: Upon clicking a Button named update A FORM should appear displaying the details of the product tha ...

Building a web proxy with node.js and express

I'm currently in the process of designing a personalized web proxy using JavaScript to allow users to surf the internet through a designated website, similar to this . One challenge I encountered is transferring the response from a URL back to the us ...