idada/v8.go — pull request #17 by andreas (2014-03-29 18:45:19+00:00)
Title: Better time support.

- Create V8 date with `NewDate(time.Time)`
- Convert V8 value to `time.Time`
- `time.Time` support for `GoValueToJsValue`
- `time.Time` support for `ToJSON`

Sample program:

```
engine := v8.NewEngine()
context := engine.NewContext(nil)

context.Scope(func(cs v8.ContextScope) {
global := cs.Global()
now := time.Now()
jsNow := engine.GoValueToJsValue(reflect.ValueOf(now))
global.SetProperty("now", jsNow, v8.PA_None)

script := engine.Compile([]byte("x = {}; x.time = now; x"), nil, nil)
result := cs.Run(script)
println(string(v8.ToJSON(result)))
})
```

Output: `{"time":"2014-03-29T19:37:39+0100"}`