derekprior / momentjs-rails Goto Github PK
View Code? Open in Web Editor NEWThe Moment.js JavaScript library ready to play with the Rails Asset Pipeline
License: MIT License
The Moment.js JavaScript library ready to play with the Rails Asset Pipeline
License: MIT License
Hi, thanks for this useful gem. Can you upgrade to version 1.7.0?
https://raw.github.com/timrwood/moment/1.7.0/moment.js
Every attempt is made to mirror the currently shipping Moment.js version number wherever possible. The major, minor, and patch version numbers will always represent the Moment.js version. Should a gem bug be discovered, a 4th version identifier will be added and incremented.
I would think there's a way to automate that, no? #40 upgraded to 2.11.0
yesterday, and moment's already at 2.11.1
. Kind of tough to keep up manually, although I applaud the effort.
Here's my quick brainstorm:
vendor/assets/javascripts
. It'll probably also need to bump the version in the gemspec somehow. I think there are gems that can do that.The result would be an automatically generated pr that looks just like #40 for every moment version.
Travis might not let you key off their repo though. Not sure. And you might need a little github user wizardry to allow a bot user to submit the PR. But I think it's all plausible, no?
I'm investigating using this for my rails project. If I use it, I will probably come back and see if I can come up with a way to automate this.
It doesn't work in the browser (maybe if you're using a browser CommonJS framework)
Hi,
I did the installation of the gem and did exactly what 'Usage' section said for use locale pt-br, but when I run my rails 4 app, open the browser console and run moment.locales(), it only returns ['en'] and the internationalization not works...
What do I forget to do?
Thanks
moment.js deprecated the use of the timezone abbreviations (e.g. "PST") in version 1.6.0. The moment-timezone.js library, however, adds support for those abbreviations back in so that the "z" and "zz" formatters can be used to properly display them. Please consider adding that library to this project so that people who want to take advantage of that library can simply #= require moment-timezone
.
Thank you.
I don't know is this the right place to ask, but using Turbolinks 5 with //= require moment
in application.js causes the back button to trigger multiple, duplicate ajax requests, the number of (identical) requests being similar to the size of the total number of cached history pages it seems.
Commenting out the js in the gemfile vendor/assets/javascripts/moment.js stops the problem.
Any clues what might be causing this in moment.js? Happening in both Rails 4 & 5 projects that have fullCalendar (not related to the calendar - this happens when not calling fullCalendar)
Sorry nothing to do with moment js, I had push/popstate javascript without realising
Hello @derekprior,
We are trying to update our applications to fix CVE-2022-24785, but we would need this project to update moment as well due to dependencies that consume it. Is this project still supported for moment version updates?
I tried using this gem and it worked for creating and manipulating moments from dates, but I kept getting errors when trying to use the isBefore and isAfter functions.
The error was that the isBefore function didn't exist on moment()
Using the raw moment.js library fixes the issue for me.
Please refer to this bug. It appears that 2.11.1 fixes it. Thanks
This issue is to simply update to capture the 2.29.4 patch in the underlying moment.js
package where that patch closes new CVE-2022-31129.
https://nvd.nist.gov/vuln/detail/CVE-2022-31129
This issue is similar to #63 and if complete will address that issue as well, since moment.js
v2.29.4 includes the patch in moment.js
v2.29.3.
There are several plugins for Moment.js: http://momentjs.com/docs/#/plugins/
It is probably overkill to create a gem for each of them so why not add them (at least the ones people ask for and are maintained) to this gem.
If twix fits my needs I willing to make a pull request for it.
Regards,
Looks like 2.0 has a lot of features and bug fixes: https://gist.github.com/timrwood/e72f2eef320ed9e37c51
Thanks for maintaining this plugin!
When using moment-timezone.js
, you need to also create a moment-timezone-data.js
file which contains the mapping for various time zones. The site for moment-timezone.js
includes a generator which makes creating this mapping pretty simple: just click a button to include a timezone in your mapping.
Nevertheless, it's a little annoying that you need to manually create a huge static file which includes a bunch of logic that's already available inside ActiveSupport::TimeZone
. It's not only tedious but also couples the Rails timezones with a static file (i.e. if Rails changes their supported zones, the mapping would need to updated correspondingly).
This give me a few possible ideas:
moment-timezone-data.js
file based the timezones defined in ActiveSupport::TimeZone
. This would ensure that the tzinfo for Rails and Moment were always in sync. The idea is similar to this post: http://metaskills.net/2012/08/05/rails-moment-js-and-time-zones/The second solution would probably be more effort but better in the long run.
Thoughts?
Hi @derekprior, thanks for making this project!
I wanted to know if this repo is still maintained? If not, I'll be happy to help maintain it.
Meanwhile I'm making a fork to update momentjs-rails
to the latest moment version (2.24.0).
Best,
Lior
Howdy,
I'm including license attributions and I noticed your copyright says YOURNAME. What should your copyright say..."Derek Prior"?
momentjs-rails-2.11.0
gem includes test/dummy/log/test.log
.
I think logs should be excluded.
With version 2.29.1
the javascript fails to work with a normal asset pipeline. Caused by #60
export declarations may only appear at top level of a module
.
I guess just the export needs to be removed?
Would it be possible to update the Moment.js gem to 2.6.0?
https://github.com/moment/moment#260-see-changelog
Can we update the current version of moment.js to 2.22.2?
With package and package-lock.json we can easily automate the assest copying we do for moment end states.
This will allow easy to put the PR out, Plus vulnerability on moment library will be marked here as well that will allow us move this faster.
There is a newer version of Moment.js: https://github.com/moment/moment/releases/tag/2.8.1 :)
I maintain a datetimepicker gem that requires the newest version of Moment.js, it would be awesome if we could get your gem up to date.
Thanks @derekprior!
Moment Timezone is at v. 0.0.1 on the Moment.js site. I'd really like to have this. Can you make it available through this gem?
'America/Mexico_City' timezone currently follows GMT-6 format, but using momentjs we get GMT-5 time format due to daylight saving in the summer, so we get a 1-hour time delay.
Mexico timezone was last updated on 30 Oct 2022 which is not updated on momentjs-rails side.
Looks like version 1.4 is out: http://momentjs.com/
Would you consider supporting Moment Timezone anytime soon? http://momentjs.com/timezone
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.