Code Monkey home page Code Monkey logo

momentjs-rails's People

Contributors

ashkulz avatar biesiad avatar brendon avatar brtdv avatar dbackowski avatar derekprior avatar dimameshcharakou avatar eddloschi avatar egeek avatar eyupatis avatar gabebw avatar gr8bit avatar koriroys avatar mdurn avatar muruvetri avatar tricknotes avatar voltechs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

momentjs-rails's Issues

Auto update?

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:

  • Create a rake task that sucks down everything from moment's repo (or wherever) and places it in 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.
  • Have a push hook off of moment.js' master branch. Every push to master on that repo, kicks a build on this repo that runs the above rake task, creates a commit based on the changes, and submits a PR with the resulting commit. EDIT: You probably still want to merge the PR manually, for a little sanity check, but at least you are getting an email on the PR saying "moment just updated". EDIT2: Might be better to not go off master and go off their releases. Not sure.

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.

moment.locales() returns only '[en]'

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

Consider including moment-timezone.js

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.

Turbolinks + moment js triggers duplicate requests on back button

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

isBefore and isAfter errors

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.

Add Moment.js plugins

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,

Include timezone data file based on zones listed in `ActiveSupport::TimeZone`

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:

  1. Create the mapping manually and include it in this gem as a static JS file. Things would still be coupled (bad) but at least the coupling would live inside the gem and could be managed by the community (better). The mapping, for example, looks something like: https://gist.github.com/coryschires/6236126
  2. Include an initializer in this gem which dynamically generates the correctly formatted 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?

Is this repo still maintained?

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

Copyright says "YOUR NAME"

Howdy,

I'm including license attributions and I noticed your copyright says YOURNAME. What should your copyright say..."Derek Prior"?

test.log in gem

momentjs-rails-2.11.0 gem includes test/dummy/log/test.log.
I think logs should be excluded.

Automate the assest copying instead of manual

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.

Moment Timezone?

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?

1-hour time delay for Mexico timezone

'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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.