You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "thanos vassilakis (JIRA)" <ji...@apache.org> on 2010/03/15 15:20:27 UTC
[jira] Created: (COUCHDB-697) today.getYear() -> 110 not 2010
today.getYear() -> 110 not 2010
-------------------------------
Key: COUCHDB-697
URL: https://issues.apache.org/jira/browse/COUCHDB-697
Project: CouchDB
Issue Type: Bug
Components: JavaScript View Server
Affects Versions: 0.10.1
Environment: windows NT, couch-0.11.0b905538
Reporter: thanos vassilakis
Simple test:
function(doc) {
var today = new Date();
var month = new Date(today.getYear(), today.getMonth(),1);
if (doc.date) {
var date = new Date(doc.date);
if (date > month && date < today)
emit(today.getYear(), month);
}
}
results in :
110
ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
Using Opera:
javascript:var today= new Date(); today.getYear();
Results in:
2010
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-697) today.getYear() -> 110 not 2010
Posted by "thanos vassilakis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
thanos vassilakis updated COUCHDB-697:
--------------------------------------
Description:
Simple test:
function(doc) {
var today = new Date();
var month = new Date(today.getYear(), today.getMonth(),1);
emit(today.getYear(), month);
}
results in :
110
ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
Using Opera:
javascript:var today= new Date(); today.getYear();
Results in:
2010
was:
Simple test:
{code:javascript}
function(doc) {
var today = new Date();
var month = new Date(today.getYear(), today.getMonth(),1);
emit(today.getYear(), month);
}
{code}
results in :
{noformat}
110
ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
{noformat}
Using Opera:
{code:javascript}
javascript:var today= new Date(); today.getYear();
{code}
Results in:
{noformat}
2010
{noformat}
> today.getYear() -> 110 not 2010
> -------------------------------
>
> Key: COUCHDB-697
> URL: https://issues.apache.org/jira/browse/COUCHDB-697
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: windows NT, couch-0.11.0b905538
> Reporter: thanos vassilakis
>
> Simple test:
> function(doc) {
> var today = new Date();
> var month = new Date(today.getYear(), today.getMonth(),1);
> emit(today.getYear(), month);
> }
> results in :
> 110
> ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
> Using Opera:
> javascript:var today= new Date(); today.getYear();
> Results in:
> 2010
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (COUCHDB-697) today.getYear() -> 110 not 2010
Posted by "thanos vassilakis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
thanos vassilakis closed COUCHDB-697.
-------------------------------------
Resolution: Not A Problem
getYear() is depreciated.
I should have used getFullYear().
> today.getYear() -> 110 not 2010
> -------------------------------
>
> Key: COUCHDB-697
> URL: https://issues.apache.org/jira/browse/COUCHDB-697
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: windows NT, couch-0.11.0b905538
> Reporter: thanos vassilakis
>
> Simple test:
> function(doc) {
> var today = new Date();
> var month = new Date(today.getYear(), today.getMonth(),1);
> emit(today.getYear(), month);
> }
> results in :
> 110
> ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
> Using Opera:
> javascript:var today= new Date(); today.getYear();
> Results in:
> 2010
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-697) today.getYear() -> 110 not 2010
Posted by "thanos vassilakis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
thanos vassilakis updated COUCHDB-697:
--------------------------------------
Description:
Simple test:
{code:javascript}
function(doc) {
var today = new Date();
var month = new Date(today.getYear(), today.getMonth(),1);
emit(today.getYear(), month);
}
{code}
results in :
{noformat}
110
ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
{noformat}
Using Opera:
{code:javascript}
javascript:var today= new Date(); today.getYear();
{code}
Results in:
{noformat}
2010
{noformat}
was:
Simple test:
function(doc) {
var today = new Date();
var month = new Date(today.getYear(), today.getMonth(),1);
if (doc.date) {
var date = new Date(doc.date);
if (date > month && date < today)
emit(today.getYear(), month);
}
}
results in :
110
ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
110
ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
Using Opera:
javascript:var today= new Date(); today.getYear();
Results in:
2010
Simplifing the description code
> today.getYear() -> 110 not 2010
> -------------------------------
>
> Key: COUCHDB-697
> URL: https://issues.apache.org/jira/browse/COUCHDB-697
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Affects Versions: 0.10.1
> Environment: windows NT, couch-0.11.0b905538
> Reporter: thanos vassilakis
>
> Simple test:
> {code:javascript}
> function(doc) {
> var today = new Date();
> var month = new Date(today.getYear(), today.getMonth(),1);
> emit(today.getYear(), month);
> }
> {code}
> results in :
> {noformat}
> 110
> ID: 9eb7affe00e4b705afa4679fa70c5938 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c53ec "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c4c93 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c3d13 "0110-03-01T05:00:00.000Z"
> 110
> ID: 9eb7affe00e4b705afa4679fa70c333e "0110-03-01T05:00:00.000Z"
> {noformat}
> Using Opera:
> {code:javascript}
> javascript:var today= new Date(); today.getYear();
> {code}
> Results in:
> {noformat}
> 2010
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.