aboutsummaryrefslogtreecommitdiffstats
path: root/library/moment/src/lib/units/day-of-year.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-11-18 23:56:25 +0100
committerMario Vavti <mario@mariovavti.com>2015-11-18 23:56:25 +0100
commitb23284cba28335f61595f2264685b1bbafc19183 (patch)
tree696cbfc2b5a609c636e0d1d7a3a2f9ad7a302266 /library/moment/src/lib/units/day-of-year.js
parent0c163c4d038a4c26335af1bde366d8ef9e53c464 (diff)
downloadvolse-hubzilla-b23284cba28335f61595f2264685b1bbafc19183.tar.gz
volse-hubzilla-b23284cba28335f61595f2264685b1bbafc19183.tar.bz2
volse-hubzilla-b23284cba28335f61595f2264685b1bbafc19183.zip
move moment.min.js and remove unneeded files
Diffstat (limited to 'library/moment/src/lib/units/day-of-year.js')
-rw-r--r--library/moment/src/lib/units/day-of-year.js49
1 files changed, 0 insertions, 49 deletions
diff --git a/library/moment/src/lib/units/day-of-year.js b/library/moment/src/lib/units/day-of-year.js
deleted file mode 100644
index 0c34fa395..000000000
--- a/library/moment/src/lib/units/day-of-year.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import { addFormatToken } from '../format/format';
-import { addUnitAlias } from './aliases';
-import { addRegexToken, match3, match1to3 } from '../parse/regex';
-import { daysInYear } from './year';
-import { createUTCDate } from '../create/date-from-array';
-import { addParseToken } from '../parse/token';
-import toInt from '../utils/to-int';
-
-// FORMATTING
-
-addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
-
-// ALIASES
-
-addUnitAlias('dayOfYear', 'DDD');
-
-// PARSING
-
-addRegexToken('DDD', match1to3);
-addRegexToken('DDDD', match3);
-addParseToken(['DDD', 'DDDD'], function (input, array, config) {
- config._dayOfYear = toInt(input);
-});
-
-// HELPERS
-
-//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
-export function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
- var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear;
- if (d < firstDayOfWeek) {
- d += 7;
- }
-
- weekday = weekday != null ? 1 * weekday : firstDayOfWeek;
-
- dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday;
-
- return {
- year: dayOfYear > 0 ? year : year - 1,
- dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
- };
-}
-
-// MOMENTS
-
-export function getSetDayOfYear (input) {
- var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
- return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
-}