Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX timezone bug in sqlite:issue #820 #822

Merged
merged 3 commits into from Dec 7, 2017
Merged

Conversation

moonrailgun
Copy link
Contributor

sample test js script

var orm = require('orm');
var path = require('path');

// orm.connect("sqlite://" + path.resolve(process.cwd(), './database.db?timezone=+08:00'), function(err, db) {
orm.connect("sqlite://" + path.resolve(process.cwd(), './database.db'), function(err, db) {
  if (err) throw err;

  var Person = db.define("person", {
		uuid: {type: 'text', required: false},
		date: {type: 'date',time: true},
	});
  console.log('current date:', new Date());
  console.log('------');
  db.sync(function() {
    Person.create({
      uuid: 1,
      date: new Date()
    }, (err, p) => {
      console.log(JSON.stringify(p));// data from memory
      console.log('------');

      Person.get(p.id, function(err, d) {
        console.log(JSON.stringify(d));// data from sqlite file
      })
    })
  })
})

@dxg
Copy link
Collaborator

dxg commented Dec 5, 2017

Looks good, can you please add a test?

@moonrailgun
Copy link
Contributor Author

Test suit have been added, thanks for review

@dxg dxg merged commit dbf3564 into dresende:master Dec 7, 2017
@dxg
Copy link
Collaborator

dxg commented Dec 7, 2017

Thanks. I've published 4.0.2 with the fix.

@moonrailgun
Copy link
Contributor Author

Welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants