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

Include milliseconds when serializing ActiveSupport::TimeWithZone to JSON #99

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,14 @@ workflows:
- ruby-2.7.2-rails-5.2
filters:
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+(\.?(RC|rc)[-\.]?\w*)?$/
branches:
ignore: /.*/
only: /^v?[0-9]+\.[0-9]+\.[0-9]+(\.?(RC|rc)[-\.]?\w*)?$/
zorab47 marked this conversation as resolved.
Show resolved Hide resolved
- generate-and-push-docs:
context: org-global
requires:
- release
filters:
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+(\.?(RC|rc)[-\.]?\w*)?$/
only: /^v?[0-9]+\.[0-9]+\.[0-9]+(\.?(RC|rc)[-\.]?\w*)?$/
branches:
ignore: /.*/
- ruby-3.0.0-rails-6.1:
Expand Down
8 changes: 6 additions & 2 deletions lib/stitches/render_timestamps_in_iso8601_in_json.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
require 'active_support/time_with_zone'

class ActiveSupport::TimeWithZone
# We want dates to be a) in UTC and b) in ISO8601 always
# We want dates to always be in UTC
def as_json(options = {})
utc.iso8601
if utc?
super
else
utc.as_json(options)
end
end
end

2 changes: 1 addition & 1 deletion lib/stitches/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Stitches
VERSION = '4.0.1'
VERSION = '4.1.0RC2'
end