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

datetime is undefined and not exported from the rrule module #551

Open
ayhid opened this issue Aug 21, 2022 · 2 comments
Open

datetime is undefined and not exported from the rrule module #551

ayhid opened this issue Aug 21, 2022 · 2 comments

Comments

@ayhid
Copy link

ayhid commented Aug 21, 2022

I am using [email protected] on macOS Monterey 12.5
node v16.13.2 (npm v8.1.2)

When I try to import datetime from rrule I got undefined

My import statement:

import datetime from 'rrule';
console.log('datetime', datetime);

Capture d’écran 2022-08-21 à 20 39 06

/* !
 * node_modules/rrule/dist/esm/index.js
 *  
 * rrule.js - Library for working with recurrence rules for calendar dates.
 * https://github.com/jakubroztocil/rrule
 *
 * Copyright 2010, Jakub Roztocil and Lars Schoning
 * Licenced under the BSD licence.
 * https://github.com/jakubroztocil/rrule/blob/master/LICENCE
 *
 * Based on:
 * python-dateutil - Extensions to the standard Python datetime module.
 * Copyright (c) 2003-2011 - Gustavo Niemeyer <[email protected]>
 * Copyright (c) 2012 - Tomi Pieviläinen <[email protected]>
 * https://github.com/jakubroztocil/rrule/blob/master/LICENCE
 *
 */
export { RRule } from './rrule';
export { RRuleSet } from './rruleset';
export { rrulestr } from './rrulestr';
export { Frequency } from './types';
export { Weekday } from './weekday';
//# sourceMappingURL=index.js.map

I also reproduced this on runkit

https://runkit.com/ayhid/runkit-npm-rrule

I don't see datetime exported there, am I missing something here ?

@JayNaire
Copy link

JayNaire commented Aug 28, 2022

It seems a lot has changed since the documentation was written! Including breaking changes around 2.7.0 according to the change log.
My workaround:
Do not use eg: datetime(2012, 12, 31) use new Date(Date.UTC(2012, 12 - 1, 31)) and manipulate dates with Date prototypes.

@1ed
Copy link

1ed commented Sep 1, 2022

See #553

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

No branches or pull requests

3 participants