项目作者: Julien-Marcou

项目描述 :
A jQuery Datepicker
高级语言: JavaScript
项目地址: git://github.com/Julien-Marcou/RendezVous.js.git
创建时间: 2015-01-21T14:35:10Z
项目社区:https://github.com/Julien-Marcou/RendezVous.js

开源协议:

下载


RendezVous.js

A jQuery Datepicker

  • Lightweight
  • Flat design
  • User friendly
  • Developer friendly
  • Uses SCSS (full em based)
  • Keep calm and Pick a date !

Some examples

RendezVous.js Demo →

How to use

  1. $('#my-datepicker').RendezVous();

How to configure

  1. var settings = { /* ... */ };
  2. $('#my-datepicker').RendezVous(settings);
  1. var callback = function(rdv) { /* ... */ };
  2. $('#my-datepicker').RendezVous(callback);
  1. var settings = { /* ... */ };
  2. var callback = function(rdv) { /* ... */ };
  3. $('#my-datepicker').RendezVous(settings, callback);

Custom settings

  1. // If false, the datepicker can be only closed by calling "close();"
  2. canClose: true
  1. // If true, the datepicker is open by default
  2. openByDefault: false
  1. // If true, the date input will be split in day, month and year inputs
  2. splitInput: false
  1. // If false, input content can be edited
  2. inputReadOnly: true
  1. // If false, input will contains the default date by default
  2. inputEmptyByDefault: true
  1. // Separator between inputs (for splitted input)
  2. inputSeparator: ' / '
  1. // Default scale at which the datepicker opens
  2. defaultScale: 'month' // month, year, decade
  1. // Input formats
  2. formats: {
  3. display: {
  4. day: '%D', // day input (for splitted input)
  5. month: '%Month', // month input (for splitted input)
  6. year: '%Y', // year input (for splitted input)
  7. date: '%D %Month %Y' // date input
  8. }
  9. }
  10. /**
  11. * Available formats
  12. *
  13. * DAYS
  14. * %d : Numeric day (e.g. 2)
  15. * %D : Numeric day with leading zeros (e.g. 02)
  16. * %da : Textual day abbreviation (e.g mon)
  17. * %Da : Textual capitalized day abbreviation (e.g Mon)
  18. * %day : Textual day (e.g monday)
  19. * %Day : Textual capitalized day (e.g Monday)
  20. *
  21. * MONTHS
  22. * %m : Numeric month (e.g. 1)
  23. * %M : Numeric month with leading zeros (e.g. 01)
  24. * %mo : Textual month abbreviation (e.g jan)
  25. * %Mo : Textual capitalized month abbreviation (e.g Jan)
  26. * %month : Textual month (e.g january)
  27. * %Month : Textual capitalized month (e.g January)
  28. *
  29. * YEARS
  30. * %y : Numeric year, 2 digits (e.g 15)
  31. * %Y : Numeric year, 4 digits (e.g 2015)
  32. *
  33. * DECADES
  34. * %x0 : Numeric decade start, 2 digits (e.g 10)
  35. * %X0 : Numeric decade start, 4 digits (e.g 2010)
  36. * %x9 : Numeric decade end, 2 digits (e.g 19)
  37. * %X9 : Numeric decade end, 4 digits (e.g 2019)
  38. */
  1. // Default selected date
  2. defaultDate: {
  3. day: today.getDate(), // 1 through 31
  4. month: today.getMonth(), // 0 through 11
  5. year: today.getFullYear() // No limits
  6. }
  1. // Current language (see live demo at http://rendezvous.julien-marcou.fr)
  2. i18n: { /* ... */ }

Custom callback

  1. $('#my-datepicker').RendezVous(function(rdv) {
  2. // To open the datepicker
  3. rdv.open();
  4. // To close the datepicker
  5. rdv.close();
  6. // To set the day of the datepicker
  7. rdv.setDay(day); // 1 through 31
  8. // To get the day of the datepicker
  9. rdv.getDay();
  10. // To set the month of the datepicker
  11. rdv.setMonth(month); // 1 through 12
  12. // To get the month of the datepicker
  13. rdv.getMonth();
  14. // To set the year of the datepicker
  15. rdv.setYear(year); // No limits
  16. // To get the year of the datepicker
  17. rdv.getYear();
  18. // To get the decade of the datepicker
  19. rdv.getDecade();
  20. // To set the date of the datepicker
  21. // (combination of the 3 previous)
  22. rdv.setDate(day, month, year);
  23. // To get the date of the datepicker (Date object)
  24. rdv.getDate();
  25. // To set the date to the previous day
  26. rdv.previousDay();
  27. // To set the date to the next day
  28. rdv.nextDay();
  29. // To set the date to the previous month
  30. rdv.previousMonth();
  31. // To set the date to the next month
  32. rdv.nextMonth();
  33. // To set the date to the previous year
  34. rdv.previousYear();
  35. // To set the date to the next year
  36. rdv.nextYear();
  37. // To set the date to the previous decade
  38. rdv.previousDecade();
  39. // To set the date to the next decade
  40. rdv.nextDecade();
  41. // To set the scale of the datepicker
  42. rdv.setScale(scale); // month, year, decade
  43. // To get the current scale of the datepicker
  44. rdv.getScale();
  45. });