anjlab-widgets 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aefb208eb0bc67c608fa241a6dccfc938e7e4624
4
- data.tar.gz: 17089bf6506785e0d33bc5e45d913f0211203c09
3
+ metadata.gz: 11d287f7ebeaf8df696a266592d281859f8e66b7
4
+ data.tar.gz: ada93498cd12be3c144524b2003af2a4ab0fd9d9
5
5
  SHA512:
6
- metadata.gz: 35bfc9b32dd0629a2761ca83225cb2a37ed0ef93a050573e96d86f2c98c3c58a5309305510d7ddd848504fb70205ae96924d0e8c92f0b1526d75dbe4e64fe948
7
- data.tar.gz: 11d6c6651b977c8c6fbd0bba27afe2106ee0ff0143fa487e7c6f89b5f8432558506a2654200c5111f965ab35a2472e77559d4ff698c2c471e3fd4bc86a0dae3b
6
+ metadata.gz: 227fcc4406d2bf1eed355ec319218fd79332bec37da156ae19a1d1a869d43f0fbad2e3f966fb6cfe9d2820f4dbcdfb0c4b14682f261c06faea606788c597e9a7
7
+ data.tar.gz: 178118d2068490670e31e628c029f41af06407293aea30e27cf17b83da6c0a24f58824e6b281c4077c519cf4e1610284673a9090a8e11b21876abd54778f45e7
@@ -35,6 +35,16 @@ Locales =
35
35
  daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"]
36
36
  months: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"]
37
37
  monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"]
38
+ ja:
39
+ dates:
40
+ format: 'yyyy/mm/dd'
41
+ weekStart: 0
42
+ days: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日", "日曜日"]
43
+ daysShort: ["日", "月", "火", "水", "木", "金", "土", "日"]
44
+ daysMin: ["日", "月", "火", "水", "木", "金", "土", "日"]
45
+ months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]
46
+ monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]
47
+
38
48
 
39
49
  DateTools =
40
50
  modes: [
@@ -201,7 +211,8 @@ class Datepicker extends NativeRailsDatepicker
201
211
  else
202
212
  @element.on 'click', $.proxy(@show, this)
203
213
 
204
- @viewMode = 0;
214
+ @startMode = options.startMode || 0
215
+ @viewMode = @startMode
205
216
  @weekStart = options.weekStart || @element.data('date-weekstart') || Locales[@locale].dates.weekStart
206
217
  @weekEnd = if this.weekStart == 0 then 6 else @weekStart - 1
207
218
  @fillDow()
@@ -227,7 +238,7 @@ class Datepicker extends NativeRailsDatepicker
227
238
  hide: ->
228
239
  @picker.hide()
229
240
  $(window).off 'resize', @place
230
- @viewMode = 0
241
+ @viewMode = @startMode
231
242
  @showMode()
232
243
  $(document).off('mousedown', @hide) if !@isInput
233
244
 
@@ -7,7 +7,7 @@ module Anjlab
7
7
  end
8
8
 
9
9
  def input
10
- time = options[:value] || @builder.object[attribute_name]
10
+ time = options[:value] || @builder.object.send(attribute_name)
11
11
 
12
12
  html = ''.html_safe
13
13
 
@@ -19,7 +19,8 @@ module Anjlab
19
19
  "data-date-allow-blank" => allow_blank,
20
20
  :value => Widgets::format_date(time),
21
21
  :required => input_html_options[:required],
22
- :class => "#{input_html_options[:date_class] || 'input-small'}"
22
+ :class => "#{input_html_options[:date_class] || 'input-small'}",
23
+ :placeholder => "#{input_html_options[:date_placeholder]}"
23
24
  }.merge(input_html_options)
24
25
 
25
26
  time_data = {
@@ -27,7 +28,8 @@ module Anjlab
27
28
  "data-rails" => true,
28
29
  :value => Widgets::format_time(time),
29
30
  :required => input_html_options[:required],
30
- :class => "#{input_html_options[:time_class] || 'input-small'}"
31
+ :class => "#{input_html_options[:time_class] || 'input-small'}",
32
+ :placeholder => "#{input_html_options[:time_placeholder]}"
31
33
  }.merge(input_html_options)
32
34
 
33
35
  case input_type
@@ -1,5 +1,5 @@
1
1
  module Anjlab
2
2
  module Widgets
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
5
5
  end
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  require "anjlab-widgets/version"
2
3
  require "anjlab-widgets/engine"
3
4
 
@@ -15,6 +16,8 @@ module Anjlab
15
16
  "%d/%m/%Y"
16
17
  when :'zh-TW'
17
18
  "%Y-%m-%d"
19
+ when :ja
20
+ "%Y/%m/%d"
18
21
  else
19
22
  "%Y-%m-%d"
20
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anjlab-widgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Korolev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-21 00:00:00.000000000 Z
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anjlab-bootstrap-rails