Skip to content

A datepicker for @twitter bootstrap forked from Stefan Petre's (of eyecon.ro), improvements by @eternicode

License

Notifications You must be signed in to change notification settings

ircflagship2/bootstrap-datepicker

 
 

Repository files navigation

bootstrap-datepicker fork description

This fork is a fork of a fork that enables week-selections using:

.datepicker({ selectWeek: true });

And replaces the format input string with two functions that converts the date from and to a string, enabling your input field to contain non-standard values, such as Week 3, 2014 for instance.

format: {
    fromString: function(value) {
        return moment(value.replace('Week ',''), 'W, GGGG');
    },
    toString: function(date) {
        return 'Week ' + moment(date).format('W, GGGG');
    }
}

Example (using moment.js)

$('#myInput').datepicker({ 
	selectWeek: true,
    format: {
        fromString: function(value) {
            return moment(value.replace('Week ',''), 'W, GGGG');
        },
        toString: function(date) {
            return 'Week ' + moment(date).format('W, GGGG');
        }
    }
});

Forked readme:

bootstrap-datepicker

This is a fork of Stefan Petre's original code; thanks go to him for getting this thing started!

Please note that this fork is not used on Stefan's page, nor is it maintained or contributed to by him.

Versions are incremented according to semver.

About

A datepicker for @twitter bootstrap forked from Stefan Petre's (of eyecon.ro), improvements by @eternicode

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 65.2%
  • CSS 29.9%
  • Python 3.0%
  • Shell 1.9%