Created
March 29, 2018 07:41
-
-
Save maximgatilin/0faa8a0bfaad5924263f27e9fdaf1f3d to your computer and use it in GitHub Desktop.
rethinkTimezones
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
r | |
.db('demo') | |
.table('trends') | |
.hasFields('Fedora 18') | |
.merge(ticket => { | |
const date = r.ISO8601(ticket('sl_created_at')).inTimezone('+05:00'); | |
return { | |
...ticket, | |
date: r.time(date.year(), date.month(), date.day(), 'Z') | |
} | |
}) | |
.group(ticket => ticket('date').toISO8601()) | |
.count() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment