sproutcore 1.5.0.rc.1 → 1.5.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/Buildfile +9 -4
- data/lib/frameworks/sproutcore/README.md +1 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Preview.pdf +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Thumbnail.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/data.plist +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image10.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image11.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image13.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image15.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image16.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image17.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image18.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image19.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image22.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image23.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image24.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image25.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image30.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image31.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image8.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image9.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +23 -25
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +160 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +73 -82
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/bind.js +110 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/collection.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/localization.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/view.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions.js → core_foundation/ext/handlebars.js} +0 -57
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +14 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +29 -37
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +71 -19
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +3 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +5 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +21 -27
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +93 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +13 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +2 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +87 -32
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +21 -25
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +15 -19
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +114 -167
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +18 -20
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +74 -72
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +36 -29
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +97 -78
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +117 -97
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +111 -108
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +231 -198
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +146 -145
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +49 -50
- data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js +122 -171
- data/lib/frameworks/sproutcore/frameworks/datetime/{tests → frameworks/core/tests}/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/{resources → frameworks/localized/resources}/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +18 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +56 -45
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +21 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +82 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +18 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +29 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +148 -107
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +31 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +16 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +38 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +37 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +247 -144
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +155 -100
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +39 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +18 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +27 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +77 -44
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +68 -33
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +168 -110
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +37 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +187 -123
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +73 -49
- data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +34 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +51 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +38 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +15 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +54 -34
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +113 -42
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +84 -28
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +67 -51
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +122 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +40 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +28 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +27 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +118 -68
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +117 -61
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +241 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +134 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +107 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +125 -48
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +165 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +73 -24
- data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +19 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +16 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +14 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +43 -37
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +8 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +14 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +16 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +13 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +58 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +34 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +25 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +70 -36
- data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +10 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +28 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +41 -43
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +42 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +94 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +41 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +18 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +7 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +34 -24
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +48 -18
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +369 -60
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +2 -405
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +3 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +50 -45
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +36 -14
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +0 -34
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +50 -61
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +45 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/testing/core.js +3 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -1
- data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -1
- data/vendor/chance/lib/chance/instance.rb +8 -6
- metadata +41 -31
- data/lib/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
- data/lib/frameworks/sproutcore/frameworks/testing/qunit.js +0 -827
data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js
RENAMED
@@ -6,28 +6,28 @@
|
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
8
|
/**
|
9
|
-
Standard error thrown by SC.Scanner when it runs out of bounds
|
9
|
+
Standard error thrown by `SC.Scanner` when it runs out of bounds
|
10
10
|
|
11
11
|
@property {Error}
|
12
12
|
*/
|
13
13
|
SC.SCANNER_OUT_OF_BOUNDS_ERROR = new Error("Out of bounds.");
|
14
14
|
|
15
15
|
/**
|
16
|
-
Standard error thrown by SC.Scanner when you pass a value not an integer.
|
16
|
+
Standard error thrown by `SC.Scanner` when you pass a value not an integer.
|
17
17
|
|
18
18
|
@property {Error}
|
19
19
|
*/
|
20
20
|
SC.SCANNER_INT_ERROR = new Error("Not an int.");
|
21
21
|
|
22
22
|
/**
|
23
|
-
Standard error thrown by SC.SCanner when it cannot find a string to skip.
|
23
|
+
Standard error thrown by `SC.SCanner` when it cannot find a string to skip.
|
24
24
|
|
25
25
|
@property {Error}
|
26
26
|
*/
|
27
27
|
SC.SCANNER_SKIP_ERROR = new Error("Did not find the string to skip.");
|
28
28
|
|
29
29
|
/**
|
30
|
-
Standard error thrown by SC.Scanner when it can any kind a string in the
|
30
|
+
Standard error thrown by `SC.Scanner` when it can any kind a string in the
|
31
31
|
matching array.
|
32
32
|
*/
|
33
33
|
SC.SCANNER_SCAN_ARRAY_ERROR = new Error("Did not find any string of the given array to scan.");
|
@@ -55,7 +55,7 @@ SC.DATETIME_ISO8601 = '%Y-%m-%dT%H:%M:%S%Z';
|
|
55
55
|
through the characters of that string from beginning to end as you request
|
56
56
|
items.
|
57
57
|
|
58
|
-
Scanners are used by DateTime to convert strings into DateTime objects.
|
58
|
+
Scanners are used by `DateTime` to convert strings into `DateTime` objects.
|
59
59
|
|
60
60
|
@extends SC.Object
|
61
61
|
@since SproutCore 1.0
|
@@ -67,9 +67,7 @@ SC.Scanner = SC.Object.extend(
|
|
67
67
|
/**
|
68
68
|
The string to scan. You usually pass it to the create method:
|
69
69
|
|
70
|
-
|
71
|
-
SC.Scanner.create({string: 'May, 8th'});
|
72
|
-
}}}
|
70
|
+
SC.Scanner.create({string: 'May, 8th'});
|
73
71
|
|
74
72
|
@property
|
75
73
|
@type {String}
|
@@ -156,29 +154,31 @@ SC.Scanner = SC.Object.extend(
|
|
156
154
|
/** @class
|
157
155
|
|
158
156
|
A class representation of a date and time. It's basically a wrapper around
|
159
|
-
the Date javascript object, KVO
|
157
|
+
the Date javascript object, KVO-friendly and with common date/time
|
160
158
|
manipulation methods.
|
161
159
|
|
162
160
|
This object differs from the standard JS Date object, however, in that it
|
163
161
|
supports time zones other than UTC and that local to the machine on which
|
164
|
-
it is running. Any time zone can be specified when creating an
|
165
|
-
object, e.g
|
162
|
+
it is running. Any time zone can be specified when creating an
|
163
|
+
`SC.DateTime` object, e.g.
|
166
164
|
|
167
|
-
|
168
|
-
|
169
|
-
|
165
|
+
// Creates a DateTime representing 5am in Washington, DC and 10am in London
|
166
|
+
var d = SC.DateTime.create({ hour: 5, timezone: 300 }); // -5 hours from UTC
|
167
|
+
var e = SC.DateTime.create({ hour: 10, timezone: 0 }); // same time, specified in UTC
|
170
168
|
|
171
|
-
|
169
|
+
and it is true that `d.isEqual(e)`.
|
172
170
|
|
173
|
-
The time zone specified upon creation is permanent, and any calls to
|
174
|
-
instance will return values expressed in that time zone.
|
171
|
+
The time zone specified upon creation is permanent, and any calls to
|
172
|
+
`get()` on that instance will return values expressed in that time zone. So,
|
175
173
|
|
176
|
-
|
177
|
-
|
174
|
+
d.get('hour') returns 5.
|
175
|
+
e.get('hour') returns 10.
|
178
176
|
|
179
|
-
|
177
|
+
but
|
180
178
|
|
181
|
-
|
179
|
+
d.get('milliseconds') === e.get('milliseconds')
|
180
|
+
|
181
|
+
is true, since they are technically the same position in time.
|
182
182
|
|
183
183
|
@extends SC.Object
|
184
184
|
@extends SC.Freezable
|
@@ -202,7 +202,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
202
202
|
|
203
203
|
/** @read-only
|
204
204
|
The offset, in minutes, between UTC and the object's timezone.
|
205
|
-
All calls to get() will use this time zone to translate date/time
|
205
|
+
All calls to `get()` will use this time zone to translate date/time
|
206
206
|
values into the zone specified here.
|
207
207
|
|
208
208
|
@property
|
@@ -211,7 +211,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
211
211
|
timezone: 0,
|
212
212
|
|
213
213
|
/**
|
214
|
-
A DateTime instance is frozen by default for better performance.
|
214
|
+
A `DateTime` instance is frozen by default for better performance.
|
215
215
|
|
216
216
|
@property
|
217
217
|
@type {Boolean}
|
@@ -219,7 +219,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
219
219
|
isFrozen: YES,
|
220
220
|
|
221
221
|
/**
|
222
|
-
Returns a new DateTime object where one or more of the elements have been
|
222
|
+
Returns a new `DateTime` object where one or more of the elements have been
|
223
223
|
changed according to the options parameter. The time options (hour,
|
224
224
|
minute, sec, usec) reset cascadingly, so if only the hour is passed, then
|
225
225
|
minute, sec, and usec is set to 0. If the hour and minute is passed, then
|
@@ -228,8 +228,8 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
228
228
|
(Parts copied from the Ruby On Rails documentation)
|
229
229
|
|
230
230
|
If a time zone is passed in the options hash, all dates and times are assumed
|
231
|
-
to be local to it, and the returned DateTime instance has that time zone. If
|
232
|
-
none is passed, it defaults to SC.DateTime.timezone
|
231
|
+
to be local to it, and the returned `DateTime` instance has that time zone. If
|
232
|
+
none is passed, it defaults to `SC.DateTime.timezone`.
|
233
233
|
|
234
234
|
Note that passing only a time zone does not affect the actual milliseconds since
|
235
235
|
Jan 1, 1970, only the time zone in which it is expressed when displayed.
|
@@ -247,7 +247,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
247
247
|
},
|
248
248
|
|
249
249
|
/**
|
250
|
-
Returns a new DateTime object advanced according the the given parameters.
|
250
|
+
Returns a new `DateTime` object advanced according the the given parameters.
|
251
251
|
Don't use floating point values, it might give unpredicatble results.
|
252
252
|
|
253
253
|
@see SC.DateTime#create for the list of options you can pass
|
@@ -262,26 +262,27 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
262
262
|
Generic getter.
|
263
263
|
|
264
264
|
The properties you can get are:
|
265
|
-
- 'year'
|
266
|
-
- 'month' (January is 1, contrary to JavaScript Dates for which January is 0)
|
267
|
-
- 'day'
|
268
|
-
- 'dayOfWeek' (Sunday is 0)
|
269
|
-
- 'hour'
|
270
|
-
- 'minute'
|
271
|
-
- 'second'
|
272
|
-
- 'millisecond'
|
273
|
-
- 'milliseconds'
|
265
|
+
- `'year'`
|
266
|
+
- `'month'` (January is 1, contrary to JavaScript Dates for which January is 0)
|
267
|
+
- `'day'`
|
268
|
+
- `'dayOfWeek'` (Sunday is 0)
|
269
|
+
- `'hour'`
|
270
|
+
- `'minute'`
|
271
|
+
- `'second'`
|
272
|
+
- `'millisecond'`
|
273
|
+
- `'milliseconds'`, the number of milliseconds since
|
274
274
|
January, 1st 1970 00:00:00.0 UTC
|
275
|
-
- 'isLeapYear'
|
275
|
+
- `'isLeapYear'`, a boolean value indicating whether the receiver's year
|
276
276
|
is a leap year
|
277
|
-
- 'daysInMonth'
|
278
|
-
- 'dayOfYear'
|
279
|
-
- 'week' or 'week1'
|
277
|
+
- `'daysInMonth'`, the number of days of the receiver's current month
|
278
|
+
- `'dayOfYear'`, January 1st is 1, December 31th is 365 for a common year
|
279
|
+
- `'week'` or `'week1'`, the week number of the current year, starting with
|
280
280
|
the first Sunday as the first day of the first week (00..53)
|
281
|
-
- 'week0'
|
281
|
+
- `'week0'`, the week number of the current year, starting with
|
282
282
|
the first Monday as the first day of the first week (00..53)
|
283
|
-
- 'lastMonday'
|
284
|
-
the date of the last or next weekday in
|
283
|
+
- `'lastMonday'`, `'lastTuesday'`, etc., `'nextMonday'`,
|
284
|
+
`'nextTuesday'`, etc., the date of the last or next weekday in
|
285
|
+
comparison to the receiver.
|
285
286
|
|
286
287
|
@param {String} key the property name to get
|
287
288
|
@return the value asked for
|
@@ -295,36 +296,36 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
295
296
|
like the C strftime function.
|
296
297
|
|
297
298
|
The format parameter can contain the following characters:
|
298
|
-
- %a
|
299
|
-
- %A
|
300
|
-
- %b
|
301
|
-
- %B
|
302
|
-
- %c
|
303
|
-
- %d
|
304
|
-
- %D
|
305
|
-
- %h
|
306
|
-
- %H
|
307
|
-
- %i
|
308
|
-
- %I
|
309
|
-
- %j
|
310
|
-
- %m
|
311
|
-
- %M
|
312
|
-
- %p
|
313
|
-
- %S
|
314
|
-
- %s
|
315
|
-
- %U
|
299
|
+
- %a -- The abbreviated weekday name (``Sun'')
|
300
|
+
- %A -- The full weekday name (``Sunday'')
|
301
|
+
- %b -- The abbreviated month name (``Jan'')
|
302
|
+
- %B -- The full month name (``January'')
|
303
|
+
- %c -- The preferred local date and time representation
|
304
|
+
- %d -- Day of the month (01..31)
|
305
|
+
- %D -- Day of the month (0..31)
|
306
|
+
- %h -- Hour of the day, 24-hour clock (0..23)
|
307
|
+
- %H -- Hour of the day, 24-hour clock (00..23)
|
308
|
+
- %i -- Hour of the day, 12-hour clock (1..12)
|
309
|
+
- %I -- Hour of the day, 12-hour clock (01..12)
|
310
|
+
- %j -- Day of the year (001..366)
|
311
|
+
- %m -- Month of the year (01..12)
|
312
|
+
- %M -- Minute of the hour (00..59)
|
313
|
+
- %p -- Meridian indicator (``AM'' or ``PM'')
|
314
|
+
- %S -- Second of the minute (00..60)
|
315
|
+
- %s -- Milliseconds of the second (000..999)
|
316
|
+
- %U -- Week number of the current year,
|
316
317
|
starting with the first Sunday as the first
|
317
318
|
day of the first week (00..53)
|
318
|
-
- %W
|
319
|
+
- %W -- Week number of the current year,
|
319
320
|
starting with the first Monday as the first
|
320
321
|
day of the first week (00..53)
|
321
|
-
- %w
|
322
|
-
- %x
|
323
|
-
- %X
|
324
|
-
- %y
|
325
|
-
- %Y
|
326
|
-
- %Z
|
327
|
-
- %%
|
322
|
+
- %w -- Day of the week (Sunday is 0, 0..6)
|
323
|
+
- %x -- Preferred representation for the date alone, no time
|
324
|
+
- %X -- Preferred representation for the time alone, no date
|
325
|
+
- %y -- Year without a century (00..99)
|
326
|
+
- %Y -- Year with century
|
327
|
+
- %Z -- Time zone (ISO 8601 formatted)
|
328
|
+
- %% -- Literal ``%'' character
|
328
329
|
|
329
330
|
@param {String} format the format string
|
330
331
|
@return {String} the formatted string
|
@@ -335,7 +336,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
335
336
|
|
336
337
|
/**
|
337
338
|
Formats the receiver according ISO 8601 standard. It is equivalent to
|
338
|
-
calling toFormattedString with the '%Y-%m-%dT%H:%M:%S%Z' format string.
|
339
|
+
calling toFormattedString with the `'%Y-%m-%dT%H:%M:%S%Z'` format string.
|
339
340
|
|
340
341
|
@return {String} the formatted string
|
341
342
|
*/
|
@@ -345,10 +346,10 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
345
346
|
|
346
347
|
/** @private
|
347
348
|
Creates a string representation of the receiver.
|
348
|
-
(Debuggers call
|
349
|
-
DateTime is designed, calling SC.DateTime._toFormattedString would
|
350
|
-
have a nasty side effect. We shouldn't therefore call any of
|
351
|
-
methods from toString)
|
349
|
+
(Debuggers often call the `toString` method. Because of the way
|
350
|
+
`DateTime` is designed, calling `SC.DateTime._toFormattedString` would
|
351
|
+
have a nasty side effect. We shouldn't therefore call any of
|
352
|
+
`SC.DateTime`'s methods from `toString`)
|
352
353
|
|
353
354
|
@returns {String}
|
354
355
|
*/
|
@@ -360,7 +361,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
360
361
|
},
|
361
362
|
|
362
363
|
/**
|
363
|
-
Returns YES if the passed DateTime is equal to the receiver, ie: if their
|
364
|
+
Returns `YES` if the passed `DateTime` is equal to the receiver, ie: if their
|
364
365
|
number of milliseconds since January, 1st 1970 00:00:00.0 UTC are equal.
|
365
366
|
This is the preferred method for testing equality.
|
366
367
|
|
@@ -373,7 +374,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
373
374
|
},
|
374
375
|
|
375
376
|
/**
|
376
|
-
Returns a copy of the receiver. Because of the way DateTime is designed,
|
377
|
+
Returns a copy of the receiver. Because of the way `DateTime` is designed,
|
377
378
|
it just returns the receiver.
|
378
379
|
|
379
380
|
@returns {DateTime}
|
@@ -384,7 +385,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
|
|
384
385
|
|
385
386
|
/**
|
386
387
|
Returns a copy of the receiver with the timezone set to the passed
|
387
|
-
timezone. The returned value is equal to the receiver (ie SC.Compare
|
388
|
+
timezone. The returned value is equal to the receiver (ie `SC.Compare`
|
388
389
|
returns 0), it is just the timezone representation that changes.
|
389
390
|
|
390
391
|
If you don't pass any argument, the target timezone is assumed to be 0,
|
@@ -414,7 +415,8 @@ SC.DateTime.mixin(SC.Comparable,
|
|
414
415
|
|
415
416
|
This value can also be customized on a per-attribute basis with the format
|
416
417
|
property. For example:
|
417
|
-
|
418
|
+
|
419
|
+
SC.Record.attr(SC.DateTime, { format: '%d/%m/%Y %H:%M:%S' })
|
418
420
|
|
419
421
|
@property
|
420
422
|
@type {String}
|
@@ -422,16 +424,11 @@ SC.DateTime.mixin(SC.Comparable,
|
|
422
424
|
recordFormat: SC.DATETIME_ISO8601,
|
423
425
|
|
424
426
|
/**
|
425
|
-
The localized day names. Add the key '_SC.DateTime.dayNames' and its value
|
426
|
-
to your strings.js file to add support for another language than English.
|
427
|
-
|
428
|
-
Default is evaluated on the document.ready event.
|
429
|
-
|
430
427
|
@property
|
431
428
|
@type {Array}
|
432
|
-
@default '
|
429
|
+
@default ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
433
430
|
*/
|
434
|
-
dayNames:
|
431
|
+
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
435
432
|
|
436
433
|
/** @private
|
437
434
|
The English day names used for the 'lastMonday',
|
@@ -443,54 +440,36 @@ SC.DateTime.mixin(SC.Comparable,
|
|
443
440
|
_englishDayNames: 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.w(),
|
444
441
|
|
445
442
|
/**
|
446
|
-
The localized abbreviated day names. Add the key
|
447
|
-
'_SC.DateTime.abbreviatedDayNames' and its value to your strings.js
|
448
|
-
file to add support for another language than English.
|
449
|
-
|
450
|
-
Default is evaluated on the document.ready event.
|
451
|
-
|
452
443
|
@property
|
453
444
|
@type {Array}
|
454
|
-
@default '
|
445
|
+
@default ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
|
455
446
|
*/
|
456
|
-
abbreviatedDayNames:
|
447
|
+
abbreviatedDayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
457
448
|
|
458
449
|
/**
|
459
|
-
The localized month names. Add the key '_SC.DateTime.monthNames' and its
|
460
|
-
value to your strings.js file to add support for another language than
|
461
|
-
English.
|
462
|
-
|
463
|
-
Default is evaluated on the document.ready event.
|
464
|
-
|
465
450
|
@property
|
466
451
|
@type {Array}
|
467
|
-
@default '
|
452
|
+
@default ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
468
453
|
*/
|
469
|
-
monthNames:
|
454
|
+
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
470
455
|
|
471
456
|
/**
|
472
|
-
The localized abbreviated month names. Add the key
|
473
|
-
'_SC.DateTime.abbreviatedMonthNames' and its value to your strings.js
|
474
|
-
file to add support for another language than English.
|
475
|
-
|
476
|
-
Default is evaluated on the document.ready event.
|
477
|
-
|
478
457
|
@property
|
479
458
|
@type {Array}
|
480
|
-
@default '
|
459
|
+
@default ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
481
460
|
*/
|
482
|
-
abbreviatedMonthNames:
|
461
|
+
abbreviatedMonthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
483
462
|
|
484
463
|
/** @private
|
485
|
-
The unique internal Date object used to make computations. Better
|
464
|
+
The unique internal `Date` object used to make computations. Better
|
486
465
|
performance is obtained by having only one Date object for the whole
|
487
|
-
application and manipulating it with setTime() and getTime()
|
466
|
+
application and manipulating it with `setTime()` and `getTime()`.
|
488
467
|
|
489
468
|
Note that since this is used for internal calculations across many
|
490
|
-
DateTime instances, it is not guaranteed to store the date/time that
|
491
|
-
any one DateTime instance represents. So it might be that
|
492
|
-
|
493
|
-
|
469
|
+
`DateTime` instances, it is not guaranteed to store the date/time that
|
470
|
+
any one `DateTime` instance represents. So it might be that
|
471
|
+
|
472
|
+
this._date.getTime() !== this._ms
|
494
473
|
|
495
474
|
Be sure to set it before using for internal calculations if necessary.
|
496
475
|
|
@@ -518,7 +497,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
518
497
|
timezone: new Date().getTimezoneOffset(),
|
519
498
|
|
520
499
|
/** @private
|
521
|
-
A cache of SC.DateTime instances. If you attempt to create a SC.DateTime
|
500
|
+
A cache of `SC.DateTime` instances. If you attempt to create a SC.DateTime
|
522
501
|
instance that has already been created, then it will return the cached
|
523
502
|
value.
|
524
503
|
|
@@ -528,7 +507,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
528
507
|
_dt_cache: {},
|
529
508
|
|
530
509
|
/** @private
|
531
|
-
The index of the lastest cached value. Used with _DT_CACHE_MAX_LENGTH to
|
510
|
+
The index of the lastest cached value. Used with `_DT_CACHE_MAX_LENGTH` to
|
532
511
|
limit the size of the cache.
|
533
512
|
|
534
513
|
@property
|
@@ -537,7 +516,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
537
516
|
_dt_cache_index: -1,
|
538
517
|
|
539
518
|
/** @private
|
540
|
-
The maximum length of _dt_cache
|
519
|
+
The maximum length of `_dt_cache`. If this limit is reached, then the cache
|
541
520
|
is overwritten, starting with the oldest element.
|
542
521
|
|
543
522
|
@property
|
@@ -546,34 +525,10 @@ SC.DateTime.mixin(SC.Comparable,
|
|
546
525
|
_DT_CACHE_MAX_LENGTH: 1000,
|
547
526
|
|
548
527
|
/** @private
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
*/
|
554
|
-
_setup: function() {
|
555
|
-
if (!SC.DateTime.dayNames) {
|
556
|
-
SC.DateTime.dayNames = '_SC.DateTime.dayNames'.loc().w();
|
557
|
-
}
|
558
|
-
|
559
|
-
if (!SC.DateTime.abbreviatedDayNames) {
|
560
|
-
SC.DateTime.abbreviatedDayNames = '_SC.DateTime.abbreviatedDayNames'.loc().w();
|
561
|
-
}
|
562
|
-
|
563
|
-
if (!SC.DateTime.monthNames) {
|
564
|
-
SC.DateTime.monthNames = '_SC.DateTime.monthNames'.loc().w();
|
565
|
-
}
|
566
|
-
|
567
|
-
if (!SC.DateTime.abbreviatedMonthNames) {
|
568
|
-
SC.DateTime.abbreviatedMonthNames = '_SC.DateTime.abbreviatedMonthNames'.loc().w();
|
569
|
-
}
|
570
|
-
},
|
571
|
-
|
572
|
-
/** @private
|
573
|
-
Both args are optional, but will only overwrite _date and _tz if defined.
|
574
|
-
This method does not affect the DateTime instance's actual time, but simply
|
575
|
-
initializes the one _date instance to a time relevant for a calculation.
|
576
|
-
(this._date is just a resource optimization)
|
528
|
+
Both args are optional, but will only overwrite `_date` and `_tz` if
|
529
|
+
defined. This method does not affect the DateTime instance's actual time,
|
530
|
+
but simply initializes the one `_date` instance to a time relevant for a
|
531
|
+
calculation. (`this._date` is just a resource optimization)
|
577
532
|
|
578
533
|
This is mainly used as a way to store a recursion starting state during
|
579
534
|
internal calculations.
|
@@ -617,11 +572,11 @@ SC.DateTime.mixin(SC.Comparable,
|
|
617
572
|
|
618
573
|
// Set up an absolute date/time using the given milliseconds since Jan 1, 1970.
|
619
574
|
// Only do it if we're given a time value, though, otherwise we want to use the
|
620
|
-
// last one we had because this _get() method is recursive.
|
575
|
+
// last one we had because this `_get()` method is recursive.
|
621
576
|
//
|
622
577
|
// Note that because these private time calc methods are recursive, and because all DateTime instances
|
623
|
-
// share an internal this._date and this._tz state for doing calculations, methods
|
624
|
-
// that modify this._date or this._tz should restore the last state before exiting
|
578
|
+
// share an internal this._date and `this._tz` state for doing calculations, methods
|
579
|
+
// that modify `this._date` or `this._tz` should restore the last state before exiting
|
625
580
|
// to avoid obscure calculation bugs. So we save the original state here, and restore
|
626
581
|
// it before returning at the end.
|
627
582
|
originalTime = this._setCalcState(start, timezone); // save so we can restore it to how it was before we got here
|
@@ -854,14 +809,15 @@ SC.DateTime.mixin(SC.Comparable,
|
|
854
809
|
/**
|
855
810
|
Returns a new DateTime object advanced according the the given parameters.
|
856
811
|
The parameters can be:
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
812
|
+
|
813
|
+
- none, to create a DateTime instance initialized to the current
|
814
|
+
date and time in the local timezone,
|
815
|
+
- a integer, the number of milliseconds since
|
816
|
+
January, 1st 1970 00:00:00.0 UTC
|
817
|
+
- a options hash that can contain any of the following properties: year,
|
818
|
+
month, day, hour, minute, second, millisecond, timezone
|
863
819
|
|
864
|
-
Note that if you attempt to create a SC.DateTime instance that has already
|
820
|
+
Note that if you attempt to create a `SC.DateTime` instance that has already
|
865
821
|
been created, then, for performance reasons, a cached value may be
|
866
822
|
returned.
|
867
823
|
|
@@ -916,7 +872,7 @@ SC.DateTime.mixin(SC.Comparable,
|
|
916
872
|
},
|
917
873
|
|
918
874
|
/** @private
|
919
|
-
Calls the create() method with the current internal _date value.
|
875
|
+
Calls the `create()` method with the current internal `_date` value.
|
920
876
|
|
921
877
|
@return {DateTime} the DateTime instance returned by create()
|
922
878
|
*/
|
@@ -928,8 +884,8 @@ SC.DateTime.mixin(SC.Comparable,
|
|
928
884
|
},
|
929
885
|
|
930
886
|
/**
|
931
|
-
Returns a DateTime object created from a given string parsed with a given
|
932
|
-
format. Returns null if the parsing fails.
|
887
|
+
Returns a `DateTime` object created from a given string parsed with a given
|
888
|
+
format. Returns `null` if the parsing fails.
|
933
889
|
|
934
890
|
@see SC.DateTime#toFormattedString for a description of the format parameter
|
935
891
|
@param {String} str the string to parse
|
@@ -1091,8 +1047,8 @@ SC.DateTime.mixin(SC.Comparable,
|
|
1091
1047
|
},
|
1092
1048
|
|
1093
1049
|
/**
|
1094
|
-
This will tell you which of the two passed DateTime is greater
|
1095
|
-
|
1050
|
+
This will tell you which of the two passed `DateTime` is greater by
|
1051
|
+
comparing their number of milliseconds since
|
1096
1052
|
January, 1st 1970 00:00:00.0 UTC.
|
1097
1053
|
|
1098
1054
|
@param {SC.DateTime} a the first DateTime instance
|
@@ -1108,8 +1064,8 @@ SC.DateTime.mixin(SC.Comparable,
|
|
1108
1064
|
},
|
1109
1065
|
|
1110
1066
|
/**
|
1111
|
-
This will tell you which of the two passed DateTime is greater
|
1112
|
-
|
1067
|
+
This will tell you which of the two passed DateTime is greater
|
1068
|
+
by only comparing the date parts of the passed objects. Only dates
|
1113
1069
|
with the same timezone can be compared.
|
1114
1070
|
|
1115
1071
|
@param {SC.DateTime} a the first DateTime instance
|
@@ -1133,10 +1089,9 @@ SC.DateTime.mixin(SC.Comparable,
|
|
1133
1089
|
Adds a transform to format the DateTime value to a String value according
|
1134
1090
|
to the passed format string.
|
1135
1091
|
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
}}
|
1092
|
+
|
1093
|
+
valueBinding: SC.Binding.dateTime('%Y-%m-%d %H:%M:%S')
|
1094
|
+
.from('MyApp.myController.myDateTime');
|
1140
1095
|
|
1141
1096
|
@param {String} format format string
|
1142
1097
|
@returns {SC.Binding} this
|
@@ -1146,7 +1101,3 @@ SC.Binding.dateTime = function(format) {
|
|
1146
1101
|
return value ? value.toFormattedString(format) : null;
|
1147
1102
|
});
|
1148
1103
|
};
|
1149
|
-
|
1150
|
-
jQuery(document).ready(function() {
|
1151
|
-
SC.DateTime._setup();
|
1152
|
-
});
|
File without changes
|
File without changes
|
@@ -0,0 +1,91 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore - JavaScript Application Framework
|
3
|
+
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
4
|
+
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
|
+
// License: Licensed under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
|
9
|
+
SC.DateTime.mixin(
|
10
|
+
/** @scope SC.DateTime */ {
|
11
|
+
|
12
|
+
/**
|
13
|
+
The localized day names. Add the key `'_SC.DateTime.dayNames'` and its
|
14
|
+
value to your `strings.js` file to add support for another language than
|
15
|
+
English.
|
16
|
+
|
17
|
+
Default is evaluated on the `document.ready` event.
|
18
|
+
|
19
|
+
@property {Array}
|
20
|
+
@default '_SC.DateTime.dayNames'.loc().w()
|
21
|
+
*/
|
22
|
+
dayNames: null,
|
23
|
+
|
24
|
+
/**
|
25
|
+
The localized abbreviated day names. Add the key
|
26
|
+
`'_SC.DateTime.abbreviatedDayNames'` and its value to your `strings.js`
|
27
|
+
file to add support for another language than English.
|
28
|
+
|
29
|
+
Default is evaluated on the `document.ready` event.
|
30
|
+
|
31
|
+
@property
|
32
|
+
@type {Array}
|
33
|
+
@default '_SC.DateTime.abbreviatedDayNames'.loc().w()
|
34
|
+
*/
|
35
|
+
abbreviatedDayNames: null,
|
36
|
+
|
37
|
+
/**
|
38
|
+
The localized month names. Add the key `'_SC.DateTime.monthNames'` and its
|
39
|
+
value to your `strings.js` file to add support for another language than
|
40
|
+
English.
|
41
|
+
|
42
|
+
Default is evaluated on the `document.ready` event.
|
43
|
+
|
44
|
+
@property
|
45
|
+
@type {Array}
|
46
|
+
@default '_SC.DateTime.monthNames'.loc().w()
|
47
|
+
*/
|
48
|
+
monthNames: null,
|
49
|
+
|
50
|
+
/**
|
51
|
+
The localized abbreviated month names. Add the key
|
52
|
+
`'_SC.DateTime.abbreviatedMonthNames'` and its value to your `strings.js`
|
53
|
+
file to add support for another language than English.
|
54
|
+
|
55
|
+
Default is evaluated on the `document.ready` event.
|
56
|
+
|
57
|
+
@property
|
58
|
+
@type {Array}
|
59
|
+
@default '_SC.DateTime.abbreviatedMonthNames'.loc().w()
|
60
|
+
*/
|
61
|
+
abbreviatedMonthNames: null,
|
62
|
+
|
63
|
+
/** @private
|
64
|
+
Called on `document.ready`.
|
65
|
+
|
66
|
+
Because localizations may have been modified by an application developer,
|
67
|
+
we need to wait for the ready event to actually evaluate the localizations.
|
68
|
+
*/
|
69
|
+
_setup: function() {
|
70
|
+
if (!SC.DateTime.dayNames) {
|
71
|
+
SC.DateTime.dayNames = '_SC.DateTime.dayNames'.loc().w();
|
72
|
+
}
|
73
|
+
|
74
|
+
if (!SC.DateTime.abbreviatedDayNames) {
|
75
|
+
SC.DateTime.abbreviatedDayNames = '_SC.DateTime.abbreviatedDayNames'.loc().w();
|
76
|
+
}
|
77
|
+
|
78
|
+
if (!SC.DateTime.monthNames) {
|
79
|
+
SC.DateTime.monthNames = '_SC.DateTime.monthNames'.loc().w();
|
80
|
+
}
|
81
|
+
|
82
|
+
if (!SC.DateTime.abbreviatedMonthNames) {
|
83
|
+
SC.DateTime.abbreviatedMonthNames = '_SC.DateTime.abbreviatedMonthNames'.loc().w();
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
});
|
88
|
+
|
89
|
+
jQuery(document).ready(function() {
|
90
|
+
SC.DateTime._setup();
|
91
|
+
});
|