logo
down
shadow

ngx bootstrap datepicker: how can i change weekdays?


ngx bootstrap datepicker: how can i change weekdays?

By : chao deng
Date : November 21 2020, 07:01 PM
To fix this issue How can I change the weekdays in the ngx bootstrap datepicker ? , Himanshu,
I was able to solve this issue:
code :
import { Component, OnInit } from '@angular/core';
import { setTheme } from 'ngx-bootstrap/utils';
import { BsLocaleService } from 'ngx-bootstrap/datepicker';
import { defineLocale } from 'ngx-bootstrap/chronos';
import { enGbLocale } from 'ngx-bootstrap/locale';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  title = 'app';

  constructor(private localeService: BsLocaleService) {
    setTheme('bs4');
    enGbLocale.weekdaysShort = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
    enGbLocale.week.dow = 0;
    defineLocale('en', enGbLocale);
  }

  ngOnInit() {
    this.localeService.use('en');
  }

}


Share : facebook icon twitter icon
Limit bootstrap-datepicker to weekdays only?

Limit bootstrap-datepicker to weekdays only?


By : Давид Цветанов
Date : March 29 2020, 07:55 AM
may help you . The latest version from https://github.com/eternicode/bootstrap-datepicker already has an option to disable selection of particular weekdays. From the docs:
daysOfWeekDisabled
code :
$('#datepicker').datepicker({
    daysOfWeekDisabled: [0,6]
});
Bootstrap datepicker change minDate/startDate from another datepicker

Bootstrap datepicker change minDate/startDate from another datepicker


By : user3699217
Date : March 29 2020, 07:55 AM
it fixes the issue I have made a jsfiddle doing what you want. As pqdong commented you were calling datetimepicker instead of datepicker when setting end date.
Here is the working javascript:
code :
$(document).ready(function(){

    $("#startdate").datepicker({
        todayBtn:  1,
        autoclose: true,
    }).on('changeDate', function (selected) {
        var minDate = new Date(selected.date.valueOf());
        $('#enddate').datepicker('setStartDate', minDate);
    });

    $("#enddate").datepicker()
        .on('changeDate', function (selected) {
            var maxDate = new Date(selected.date.valueOf());
            $('#startdate').datepicker('setEndDate', maxDate);
        });

});
Bootstrap 3 Datepicker v4: dp.show and dp.change events are not fired when datepicker is inline

Bootstrap 3 Datepicker v4: dp.show and dp.change events are not fired when datepicker is inline


By : Ricardo Montañana Gó
Date : March 29 2020, 07:55 AM
I wish this help you The issue is that the dp.show event doesn't trigger when the widget is inline.
According to plugin documentation, the dp.show event is only emitted from toggle() or show() functions, but only if the widget was hidden before the call.
code :
$('#datetimepicker').datetimepicker({
    inline: true,
    format: 'DD/MM/YYYY'
}).on('dp.show dp.change', function () {
    // console.log('dp.show or dp.change event');
    $(".datepicker-days").find("th").eq(1)
        .removeAttr('title')
        .css('cursor', 'default')
        .css('background', 'inherit')
        .on('click', function (e) {
            e.stopPropagation();
        });
 });

$('#datetimepicker').data("DateTimePicker").hide();
$('#datetimepicker').data("DateTimePicker").show();
How to get special day of week and list of weekdays using bootstrap datepicker in PHP

How to get special day of week and list of weekdays using bootstrap datepicker in PHP


By : A.Gh
Date : March 29 2020, 07:55 AM
this will help I'm using Bootstrap datepicker and I'd like to get special days of every week ( Like: Monday, Wednesday, Saturday). For example, If we select every monday and Wednesday then select only Monday and Wednesday. , I´ve found the solution :
code :
 $start_date = "28-06-2016";
 $end_date = "28-07-2016";
 $weekdays = [1,2]; // 0 = sunday, 1 = monday ...

 $range_date = array();
 for ($i = strtotime($start_date); $i <= strtotime($end_date); $i = strtotime('+1 day', $i)) 
 {
     if(in_array(date('N', $i), $weekdays))//Monday == 1
     {
           echo date('l Y-m-d', $i).'<br>'; //prints the date only if it's a Monday or tuseday etc..
      }
 }
 Tuesday 2016-06-28
 Monday 2016-07-04
 Tuesday 2016-07-05
 Monday 2016-07-11
 Tuesday 2016-07-12
 Monday 2016-07-18
 Tuesday 2016-07-19 
 Monday 2016-07-25
 Tuesday 2016-07-26
jQuery UI Datepicker - allow only certain weekdays

jQuery UI Datepicker - allow only certain weekdays


By : Alex Pennells
Date : March 29 2020, 07:55 AM
it helps some times I'm using jquery UI datepicker on a huge project and I realize now that I'll need to allow only certain weekdays on some areas. I read their documentation and didn't find anything about it.. I know that there are some datepickers scripts for jq which can do this but I don't want to use any additional script for this if it's possible. Anyone know any workaround for this? Maybe I'm misunderstood anything in their documentation?
Related Posts Related Posts :
  • Difference between graph database: Neo4j & AllegroGraph
  • Linq2Sql How to write outer join query?
  • Why Lucene merge indexes?
  • What tag export formats are there?
  • How to generate irregular ball shapes?
  • link with static library vs individual object files
  • How to avoid copying dependencies with Ivy
  • Recognizing when to use the modulus operator
  • Squid handling of concurrent cache misses
  • windows server 2008 issue
  • wsdl2java exception
  • which is the best iPhone and Android Simulator for Kubuntu Linux?
  • Open Microsoft Word in "compare document" mode from command prompt
  • What is a header? Especially, what are POST@GET headers?
  • Tomcat fails to start because of jdbc driver loading
  • Reimplementing data structures in the real world
  • Condition check inside a function or before its call?
  • Is it possible to embed dynamic text into Keynote'09?
  • VS2010 express beta2 - no add reference dialog, no open file/project dialogs
  • Starting Java applet directly from jar file
  • How is other content besides views handled with PortableAreas from the MVCContrib library?
  • Nabaztag alternatives?
  • I've made something that might be useful to the community. Now what?
  • JasperReports multi-page report with different content
  • Clojure agents consuming from a queue
  • Use single static image as map
  • Why does this B+ tree have repeated elements?
  • OpenLayers eraseFeatures doesn't erase features from map screen
  • Can you help me think of problems for my programming language?
  • How to merge/crosslink Javadoc?
  • How do you automate building notes NTF files from lotus script files (lss) file?
  • How to build a programmer's wiki
  • How not to output default T4 generated file?
  • RichTextBox EnableAutoDragDrop=true requires CTRL key pressed when dropping a ListBox item?
  • How can I get Symbolic-Name of an Osgi bundle which is using one of my exported packages?
  • Get network address of a file in AppleScript
  • What is purpose of T4 Generator in T4toolbox
  • How to correctly formalize the command line usage of GNU/Linux commands?
  • What's the difference between a UseCase and a Workflow?
  • How to write a virtual machine
  • NServiceBus FullDuplex sample compiled and debugging against .NET 4.0 framework throws exception
  • Glade: How do I pass more than one argument to a signal handler?
  • Case statements in VHDL
  • New NSData with range of old NSData maintaining bytes
  • How do I convert a column of text URLs into active hyperlinks in Excel?
  • serial port parity
  • @Override fix-code shortcut in NetBeans
  • Import small number of records from a very large CSV file in Biztalk 2006
  • How to clear browser's cache from server side?
  • Execute remote Lua Script
  • Website.com/cpanel access
  • Which LOGO implementation?
  • How to add files to a document library in a site definition in SharePoint 2007?
  • JavaFX layouts question
  • Is it possible to access variable of subclass using object of superclass in polymorphism
  • How can the reliability of Software be checked through analysis?
  • Prototype Multi-Event Observation for Multi-Elements
  • maximum stored proc name in firebird
  • AutoComplete implementation
  • How is it that i am getting two different open ids for the same site for the same user
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk