Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

moment-timezone #625

Open
guybedford opened this issue Oct 18, 2015 · 9 comments
Open

moment-timezone #625

guybedford opened this issue Oct 18, 2015 · 9 comments

Comments

@guybedford
Copy link
Member

Continuing from jspm/jspm-cli#1193

@lookfirst
Copy link
Contributor

I'm using the following overrides.

      "npm:[email protected]": {
        "registry": "jspm",
        "dependencies": {
          "moment": "npm:moment@^2.10.6"
        },
        "shim": {
          "moment-timezone": {
            "deps": [
              "moment"
            ]
          }
        }
      },
      "npm:[email protected]": {
        "main": "moment",
        "format": "global",
        "shim": {
          "locale/*": {
            "deps": [
              "../moment"
            ]
          }
        }
      }

@lookfirst
Copy link
Contributor

Also...

      "github:siddii/[email protected]": {
        "main": "dist/angular-timer",
        "registry": "jspm",
        "format": "global",
        "dependencies": {
          "angular": "^1.4.1",
          "moment": "npm:moment@^2.10.6",
          "humanize-duration": "^3.0.0"
        },
        "shim": {
          "dist/angular-timer": {
            "deps": [
              "angular",
              "humanize-duration",
              "moment"
            ]
          }
        }
      },

@seangwright
Copy link

@lookfirst I've been trying to get moment-timezone to work for an angular module ( https://github.com/alexcheng1982/angular-timezone-select ) but I can't get the timezone data to load correctly. When I break here https://github.com/alexcheng1982/angular-timezone-select/blob/master/dist/angular-timezone-select.js#L5 .tz is not defined as a property of moment.

The angular module doesn't have any dependencies defined for moment or moment-timezone so I imagine I will either have to add those dependencies directly to my app or modify the file in the angular-timezone-select package directly.

How did you get this working?

@lookfirst
Copy link
Contributor

I did the overrides above and this import:

import moment from 'moment-timezone';

@cAhmad
Copy link

cAhmad commented Nov 12, 2015

@lookfirst I'm using this override :

"npm:[email protected]": {
  "map": {
    "moment": "moment"
  }
}

@naz
Copy link

naz commented Nov 26, 2015

I'm stuck with the same problem, can't load moment-timezone-with-data as a main source for moment. Tried installing with: jspm install npm:moment-timezone -o '{ main: "builds/moment-timezone-with-data", dependencies: { moment: "^2.10.6" }, shim: { "moment-timezone": { deps: [ "moment" ] } } }' but that didn't help much.

@naz
Copy link

naz commented Nov 26, 2015

I suspect it has something to do with loading moment-timezone multiple times. As the errors are pretty similar - moment/moment-timezone#193

@lookfirst
Copy link
Contributor

Use my overrides above. Works fine.

@naz
Copy link

naz commented Nov 26, 2015

@lookfirst oh man, if you ever come to visit Cracow, ping me, I owe you some good 🍺 😄 I've spent about 2 hours digging around this problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants