This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function authenticateParseUser(authResponse) { | |
Parse.FacebookUtils.logIn({ | |
id: authResponse.userID, | |
access_token: authResponse.accessToken, | |
expiration_date: moment().add('s', authResponse.expiresIn).format() | |
}).then(function(user){ | |
/* Do useful stuff with your new Parse.User */ | |
}, function(error){ | |
/* Something went wrong with the authentication */ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parseDate = function(parseDateString) { | |
var pattern = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d+)Z$/g; | |
var match = pattern.exec(parseDateString); | |
var date = new Date(match[1],parseInt(match[2])-1,match[3]-1,match[4],match[5],match[6],match[7]); | |
return date; | |
}; |