Module: DatePicker::Mappings

Defined in:
lib/date_picker/mappings/moment.rb,
lib/date_picker/mappings/flatpickr.rb,
lib/date_picker/mappings/jquery_ui.rb,
lib/date_picker/mappings/pickadate.rb

Class Method Summary collapse

Class Method Details

.flatpickrObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/date_picker/mappings/flatpickr.rb', line 3

def self.flatpickr
  {
    # Escape sequence
    __: '\\\\\\\\*', 
    # Year with century
    Y: 'Y',
    # Year without a century (00..99)
    y: 'y',
    # Day of month, blank-padded (1..31)
    e: 'j',
    # Day of the month (01..31)
    d: 'd',
    # Day of the year (001..366)
    j: 'DDD',
    # The abbreviated weekday name (“Sun”)
    a: 'D',
    # The full weekday name (“Sunday”)
    A: 'l',
    # Month of the year (01..12)
    m: 'm',
    # Month of the year no-padded (1..12)
    '-m': 'n',
    # The full month name (“January”)
    B: 'F',
    # The abbreviated month name (“Jan”)
    b: 'M',
    # Hour of the day, 24-hour clock (00..23)
    H: 'H',
    # Hour of the day, 12-hour clock (01..12)
    I: 'h',
    # Minute of the hour (00..59)
    M: 'i',
    # Second of the minute (00..60)
    S: 'S',
    # Meridian indicator (“AM” or “PM”)
    p: 'K',
    # Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
    U: 'ww',
    # Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
    W: 'WW',
    # Day of the week (Sunday is 0, 0..6)
    w: 'd',
    # Time zone as hour and minute offset from UTC (e.g. +0900)
    z: 'x'
  }
end

.jquery_uiObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/date_picker/mappings/jquery_ui.rb', line 3

def self.jquery_ui
  {
    # Escape sequence
    __: "'*'",
    # Year with century
    Y: 'yy',
    # Year without a century (00..99)
    y: 'y',
    # Day of month, blank-padded (1..31)
    e: 'd',
    # Day of the month (01..31)
    d: 'dd',
    # The abbreviated weekday name (“Sun”)
    a: 'D',
    # The full weekday name (“Sunday”)
    A: 'DD',
    # Month of the year (01..12)
    m: 'mm',
    # The full month name (“January”)
    B: 'MM',
    # The abbreviated month name (“Jan”)
    b: 'M',
    # Day of the week (Sunday is 0, 0..6)
    w: 'd',
    # Time zone as hour and minute offset from UTC (e.g. +0900)
    z: 'ZZ'
  }
end

.momentObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/date_picker/mappings/moment.rb', line 3

def self.moment
  {
    # Escape sequence
    __: '[*]', 
    # Year with century
    Y: 'YYYY',
    # Year without a century (00..99)
    y: 'YY',
    # Day of month, blank-padded (1..31)
    e: 'D',
    # Day of the month (01..31)
    d: 'DD',
    # Day of the year (001..366)
    j: 'DDD',
    # The abbreviated weekday name (“Sun”)
    a: 'ddd',
    # The full weekday name (“Sunday”)
    A: 'dddd',
    # Month of the year (01..12)
    m: 'MM',
    # The full month name (“January”)
    B: 'MMMM',
    # The abbreviated month name (“Jan”)
    b: 'MMM',
    # Hour of the day, 24-hour clock (00..23)
    H: 'HH',
    # Hour of the day, 12-hour clock (01..12)
    I: 'hh',
    # Minute of the hour (00..59)
    M: 'mm',
    # Second of the minute (00..60)
    S: 'ss',
    # Meridian indicator (“AM” or “PM”)
    p: 'A',
    # Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
    U: 'ww',
    # Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
    W: 'WW',
    # Day of the week (Sunday is 0, 0..6)
    w: 'd',
    # Time zone as hour and minute offset from UTC (e.g. +0900)
    z: 'ZZ'
  }
end

.pickadateObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/date_picker/mappings/pickadate.rb', line 3

def self.pickadate
  {
    # Escape sequence
    __: '!*', 
    # Year with century
    Y: 'yyyy',
    # Year without a century (00..99)
    y: 'yy',
    # Day of month, blank-padded (1..31)
    e: 'd',
    # Day of the month (01..31)
    d: 'dd',
    # Day of the year (001..366)
    j: '',
    # The abbreviated weekday name (“Sun”)
    a: 'ddd',
    # The full weekday name (“Sunday”)
    A: 'dddd',
    # Month of the year (01..12)
    m: 'mm',
    # The full month name (“January”)
    B: 'mmmm',
    # The abbreviated month name (“Jan”)
    b: 'mmm',
    # Hour of the day, 24-hour clock (00..23)
    H: 'HH',
    # Hour of the day, 12-hour clock (01..12)
    I: 'hh',
    # Minute of the hour (00..59)
    M: 'i',
    # Second of the minute (00..60)
    S: '',
    # Meridian indicator (“AM” or “PM”)
    p: 'A',
    # Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
    U: '',
    # Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
    W: '',
    # Day of the week (Sunday is 0, 0..6)
    w: '',
    # Time zone as hour and minute offset from UTC (e.g. +0900)
    z: ''
  }
end