<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js"></script>
<title>gallery-time-format showcase</title>
</head>
<body>
<script type="text/javascript">
YUI({ gallery: 'gallery-2012.08.01-13-16' }).use('gallery-time-format', function (Y) {
var to = new Date('2012-02-12T11:00:00Z'),
from;
from = new Date('2012-02-12T14:00:00Z');
console.log(Y.DataType.Date.format(to, { from: from, relativeDelta: 3*60*60 }), 'about 3 hours before');
// time different is bigger than relativeDelta
from = new Date('2012-02-12T17:00:00Z');
console.log(Y.DataType.Date.format(to, { from: from, relativeDelta: 3*60*60 }), '2012-02-12');
// 1 hour earlier
from = new Date('2012-02-12T10:00:00Z');
console.log(Y.DataType.Date.format(to, { from: from, relativeDelta: 3*60*60 }), 'about an hour ahead');
// support different format
from = new Date('2012-02-12T17:00:00Z');
console.log(Y.DataType.Date.format(to, { from: from, relativeDelta: 3*60*60, format: '%x' }), '02/12/12');
})
</script>
</body>
</html>
/home/y/libexec/ant/bin/ant all
Buildfile: build.xml
[echo] Starting Build For gallery-time-format
clean:
init:
[mkdir] Created dir: /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp
[echo] Starting Build For gallery-time-format
-lint-server:
[echo] Starting Build For gallery-time-format
-node:
[echo] For faster builds, install Node.js.
-concatdebug:
[copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp/ant
[delete] Deleting directory /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp/ant
-registerdebug:
[copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp
-prependdebug:
-appenddebug:
builddebug:
-createcore:
[copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp
-loggerregex:
buildcore:
-rollupjs:
-concatskins:
-buildskins:
-rollupcss:
buildskins:
-buildlangs:
-rolluplangs:
buildlangs:
build:
minify:
[yuicompressor] Compressing /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp/gallery-time-format.js
[yuicompressor] Compressed to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp/gallery-time-format-min.js
lint:
[echo] Using Rhino. Install nodejs to improve jslint speed, or skip with -Dlint.skip=true
[java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-time-format/build_tmp/gallery-time-format.js
[java] - OK
local:
deploybuild:
[copy] Copying 3 files to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-time-format
deployassets:
deployskins:
deploylang:
deploydocs:
deploy:
all:
BUILD SUCCESSFUL
Total time: 2 seconds
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info