TrimPath Forum


About TrimPath stuff, like Junction, Next Action, JavaScript Templates, TrimQuery, TrimSpreadsheet, etc...

You are not logged in.

#1 2005-10-23 05:14:36

msjacoby23
New member
Registered: 2005-10-23
Posts: 8

Dates?

Does NumSum offer support for calendar date data types?
If so, how?
If not - damn it needs to!

Offline

 

#2 2006-03-13 19:52:36

Ntrancer
New member
Registered: 2006-03-13
Posts: 1

Re: Dates?

I'm a rank noob at spreadsheets, but I agree with msjacoby23, NumSum needs them dates!  Has NumSum been able to get a date since last October?  Anyone know how long it will be before NumSum starts dating? 
Seriously, NumSum is perfect for people who freelance or travel a lot.  For billing hours, it's a massive step above exporting, cleaning up and pasting into an email. 
Thank you!

Offline

 

#3 2006-03-29 01:11:27

numsuming
New member
Registered: 2006-03-29
Posts: 1

Re: Dates?

Date functionality is an absolute must have!

Offline

 

#4 2006-04-04 11:10:10

ecmanaut
New member
Registered: 2006-04-04
Posts: 1

Re: Dates?

There is certainly some support, but it's kind of useless without docs. The formula =Date(2006,4,1) shows a (really ugly) string representation of the first of April in the rendered chart, but I have not managed to come up with how to do date arithmetics on fields, such as =A6 (the cell I put the above in), i e =A6+1 does not pick the date following April 1st, nor have I figured out how to find a week day name or number given a date reference.

Offline

 

#5 2006-11-20 14:59:39

ahab
New member
Registered: 2006-11-20
Posts: 2

Re: Dates?

There definitely is some support for Time and Date albeit through JavaScript.

Just try the following:
A1: =new Date( 2006, 10, 20, 13, 45, 59, 101)
this makes cell A1 a JavaScript Date object with (almost!) the specified date in it *).
We can extract e.g. the year from this Date object using the JavaScript getFullYear() function:
A2: =A1.getFullYear()

To manipulate a JavaScript Date object in NumSum it seems easier to convert it to a value:
A3: = A1.valueOf()
this will give use the date and time in cell A1 in milliseconds.
Now we can do a calculation with that, e.g. add one day = 1000 milliseconds * 60 seconds * 60 minutes * 24 hours and create a new Date object from that:
A4: =new Date(A3+1000*60*60*24)

As it would be nice to retrieve the weekday from the new date in A4 we can apply e.g. the toUTCString() or toLocaleString and take a substring from this result.
A5: =A4.toUTCString()
A6: =A4.toLocaleString()
A7: =A4.toUTCString().substring(0,3)
A8: =A4.toLocaleString().substring(0,2)

Finally we try to create a Date object by parsing a string with Date.parse(), which converts the date/time string to milliseconds and uses this result to create a new Date object:
A9: =new Date(Date.parse( "Mon, 20 Nov 2006 15:44:04 UTC+0100"))

Note: As you can see converting from a string - via milliseconds - to a Date object doesn't suffer from the 'aberrant month' *) problem we had setting year, month, day, etc. as number values.


Being able to use JavaScript in NumSum is one of the most exciting features of this spreadsheet. It is however no mean feat to start using JavaScript function and methods; ideally these should be wrapped in more convenient spreadsheet functions with well-known names...



*)'aberrant month': [When I input new Date( 2006,11,20) {the other parameters can be left out at will} this date was translated in the NumSum spreadsheet as 'Wed December 20 00:00:00 UTC+0100 2006', so the month was one month off. I don't know (yet) if this error is a flaw of JavaScript/JScript on my MS-IE 6 or if it is an error in the display function for Date objects in NumSum.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson