Coder Social home page Coder Social logo

momentjs.com's Introduction

NPM version NPM downloads MIT License Build Status Coverage Status FOSSA Status SemVer compatibility

A JavaScript date library for parsing, validating, manipulating, and formatting dates.

Project Status

Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.

For more details and recommendations, please see Project Status in the docs.

Thank you.

Resources

License

Moment.js is freely distributable under the terms of the MIT license.

FOSSA Status

momentjs.com's People

Contributors

bcliffor avatar behrang avatar clayzermk1 avatar dependabot[bot] avatar dhurlburtusa avatar ellenaua avatar fbonzon avatar flecno avatar galtalmor avatar gilmoreorless avatar icambron avatar ichernev avatar jervelund avatar kuntau avatar liunian avatar maggiepint avatar marcus13371337 avatar marwahaha avatar mattjohnsonpint avatar mmozuras avatar oerd avatar philfreo avatar quannt avatar richardlitt avatar robgallen avatar shaedrich avatar timrwood avatar tracygjg avatar xsoh avatar ylc265 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

momentjs.com's Issues

Select Etc/* time zones in Time Zone Builder

Currently you cannot select the Etc/* time zones in the Time Zone Builder.

Example:

'Etc/UTC'

I created the issue here first before making the change and subsequent pull request, because I wasn't sure if this was by design.

Test reporting on IE8

Running tests on IE8 goes really slow, but it works... right up to the end when all tests are done.

The test page tries to call console.log, which doesn't exist on IE8.

In order to build the buttons for submitting the test failure, you have to first shim the console.log function to do nothing (see http://stackoverflow.com/a/5967632/634824). Otherwise, it just fails with a scripting error and you can't submit the bug report.

Not sure how to build

If I do a clone --recurisve on this, then run npm install, I should be able to just run grunt to build, right? However, I get this:

isaac@ironhide [07:10:42] [~/code/momentjs.com] [gh-pages]
-> % grunt
Loading "html.js" tasks...ERROR
>> Error: Cannot find module 'moment'
Warning: Task "html" not found. Use --force to continue.

Aborted due to warnings.

Not sure what to do.

relativeTime docs out of date

It took me a while digging through issues to figure it out, but relativeTime is done differently now than it used to be. The docs need updating!

Time Zone Data Updates

We're currently handing out tzdb 2013c data on the moment-timezone site. The current version is 2013g.

We need to update, and we need a process in place for keeping it up to date.

@ichernev, @icambron - do you want me to maintain releases for moment-timezone and the related site? Or do you want them as part of the same process as moment?

Please don't encourage hotlinking to rawgithub.com

The three most prominent links on momentjs.com point to rawgithub.com URLs:

https://github.com/moment/momentjs.com/blob/gh-pages/index.html#L45-L54

As a result, many people use those rawgithub.com URLs directly in their projects. When those projects are production websites with lots of traffic, rawgithub.com gets slammed. Yesterday, for example, npr.org hotlinked to moment.js via rawgithub.

rawgithub.com is a free service meant to help developers test and demo their code. It's not a CDN. Please link to cdnjs or another real CDN instead.

New languages need to be added to web site

From the changelog:

Breton (br)
Modern Greek (el)
Hindi (hi)
Georgian (ka)
Norwegian Nyorsk (nn)
Slovak (sk)

Need to be added to the Languages section of the moment.js home page.

Add support information

There isn't anything on momentjs.com that describes where to get support.

I recommend we add some links pointing at the GitHub issue tracker, and some text indicating to post questions on StackOverflow under the momentjs tag.

We might also want to consider a discussion group, such as on Google Groups. For some projects that can be extremely useful. But for others it just leads to noise. Not sure your opinions on that.

How do you run momentjs.com on localhost

I think the process around running the website on the local machine is not clean enough. I tried from the gh-pages branch, had to install a bunch of things globally (like grunt and compass), had to update submodules etc.

When there is a bug in the test that only happens on browsers (like moment/moment#625) running on localhost is the only sane way to debug it (or am I wrong?).

Reset language on all pages

Like #65, but for the rest of the pages. Users will generally expect to run examples from the console while visiting momentjs.com, and they'll expect it to default to English. For example, see moment/moment#1245

Translating the website

Hello Tim,
Are you planning to make momentjs.com translatable? Is there any way to make that possible? If so, I could start translating into Russian (for now).
Thanks!

Package manager boxes are selectable with no target

The selectable class is applied to the package manager boxes on the home page. This gives a pointer cursor when hovering, but clicking goes nowhere.

Either they should not be selectable, or clicking them should link to the package's page on bower/npm/nuget, probably in a new window or tab.

humanizeDuration deprecation notice

Can you add a humanizeDuration deprecation notice please? That functionality still works in 1.6.0, but it is better provided by moment.duration(duration).humanize().

FPO

Under the Manipulate header, it just says FPO.

2.1.0 Docs

https://gist.github.com/timrwood/b8c2d90d528eddb53ab5

  • Week Years
  • Weekdays
  • ISO Week
  • Zone Setter
  • moment.updateOffset
  • Lang#ordinal token argument
  • Lang#isPM
  • Lang#meridiemParse
  • ASP.NET duration parsing
  • Moment#month name parsing
  • Moment#day name parsing
  • Moment#zoneName
  • Moment#zoneAbbr
  • Moment#startOf('week') and Moment#endOf('week') use locale week start
  • Moment#min
  • Moment#max
  • Moment#toISOString
  • Duration#add
  • Duration#subtract
  • Duration#get
  • Duration#as

Changes to document

Breaking changes

  • isValid() returns true for dates that get moved by DSTs ( #1140)
  • format() returns 'Invalid date' for invalid dates - (#1140)
  • toString() always returns the string in English (#1111) We don't seem to document this at all.
  • Renamed moment+langs.js to moment-with-langs.js (#1138)

New features

  • parsingFlags() (#1140)
  • isDSTShifted() (#1140)
  • New parsing formats - w, ww, W, WW, e, E, d, dd, ddd, dddd (#1141)
  • New languages: Bosnian (#1144), Uzbek (#1129), Aussi English (#1126)
  • parseZone() (#1106)
  • invalidMoment() (#1098)
  • listing functions: months, shortMonths, weekdays, weekdaysShort, weekdaysMin (#1097)
  • Allow noGlobal with AMD (#1089)
  • normalizeUnits() (#1074)
  • .NET-style duration parser now accepts times without seconds (#1059)
  • Strict parsing (#913)

Enhancements

  • Updates to Bulgarian (#1149), Hungarian (#1137), Dutch (#1093) Release notes only
  • Languages now export themselves. (#1147) Probably unnecessary to document.
  • Selecting a language returns the language identifier (#1142)
  • Can select from an array of languages (#1142)
  • Language selection substrings of the language identifier (#1142)
  • Use heuristics for choosing between array formats (#1094)
  • ISO parser accepts weeks and ordinals (#1141)

Option to get sameDay or nextDay without the time portion

Please consider adding a variant of calendar() which returns only the day and excludes the time portion.

I'm using momentjs to display the day for a 5-day forecast. For the current day and next day I want to show 'Today' and 'Tomorrow' in the appropriate localized string. The moment().calendar() function would work great but it returns the time as well as day. So hte only way for me to display the localized terms is to fallback to custom JS for these two and then use moment for the 3rd and 4th days (or extend the calendar() function for all the various languages I might need, which is not ideal given all the terms are already in moment's localization.

Feature Suggestion: Please permit zero padding of dates and times.

Hello,
I could not find a place to request a feature, so I am sending it here. :) We need to be able to display dates and times in a column on a screen. The current definition of LT does not zero pad the time, so we get a ragged display of the columns of date and times. I've changed LT to use "hh:mm A", but it would be great to have the date and time formats provide zero padded and not padded forms.

For example:
LT: "hh:mm A",
lt: "h:mm A",
something like that... :)

Here is the change that I made to your script for our application:

    // ABOH: LT was h:mm A
    _longDateFormat : {
        LT : "hh:mm A",
        L : "MM/DD/YYYY",
        LL : "MMMM D YYYY",
        LLL : "MMMM D YYYY LT",
        LLLL : "dddd, MMMM D YYYY LT"

Could you please add this feature request to your list?
Thank you,
Mike

zone() does not work as expected-- Docs need to be more explicit, should mention moment-timezone here.

The docs for zone() say:

"As of version 2.1.0, it is possible to set the offset by passing in the number of minutes offset from GMT."

Based on that, I would expect the following to take a time from the Eastern Time Zone and end up the the time expressed in UTC:

console.log("should say 13:00: %s",moment("2014-01-08 8:00 AM").zone(300).toISOString());

However, if you run that an environment where the host time zone is UTC, it will produce the wrong result. (If you run it in Eastern Time, it works). Based on that, it appears that zone(300) is not really "setting the offset" in this case. I'm not sure what's it's doing. The docs should clarify this.

The following works, whether it is run from a host in the UTC time zone or the 'America/Indianapolis' time zone:

console.log("should say 13:00: %s",moment.tz("2014-01-08 8:00 AM","America/Indianapolis").toISOString());

Perhaps the zone() docs should be updated to recommend using moment-timezone() for the kinds of operations it can't reliably handle itself.

It seems like Moment-timezone is going to be a better choice most of the time over zone(), as specific offsets don't take into account daylight savings time, while a time zone declaration like 'America/Indianapolis' will do that.

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.