{"id":1067,"url":"https://github.com/novalagung/nvdate","last_synced_at":"2025-08-22T05:32:12.359Z","repository":{"id":13835364,"uuid":"16532238","full_name":"novalagung/nvdate","owner":"novalagung","description":"📅 Swift4 Date extension library","archived":false,"fork":false,"pushed_at":"2018-05-25T07:22:46.000Z","size":131,"stargazers_count":174,"open_issues_count":1,"forks_count":23,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-29T21:05:26.840Z","etag":null,"topics":["cocoapods","ios","objective-c","swift","swift4"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/novalagung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-05T01:52:54.000Z","updated_at":"2024-03-21T02:25:08.000Z","dependencies_parsed_at":"2022-11-28T10:39:09.512Z","dependency_job_id":null,"html_url":"https://github.com/novalagung/nvdate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novalagung%2Fnvdate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novalagung%2Fnvdate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novalagung%2Fnvdate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novalagung%2Fnvdate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/novalagung","download_url":"https://codeload.github.com/novalagung/nvdate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230068142,"owners_count":18167754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","ios","objective-c","swift","swift4"],"created_at":"2024-01-05T20:15:38.200Z","updated_at":"2024-12-20T09:07:20.888Z","avatar_url":"https://github.com/novalagung.png","language":"Swift","funding_links":[],"categories":["Date \u0026 Time","Libs","Date [🔝](#readme)"],"sub_categories":["Getting Started","Date","Linter"],"readme":"Introduction\n======\n\n[![Build Status](https://travis-ci.org/novalagung/nvdate.svg?branch=master)](https://travis-ci.org/novalagung/nvdate)\n[![CocoaPods](https://img.shields.io/cocoapods/v/NVDate.svg)](https://cocoapods.org/pods/NVDate)\n![CocoaPods](https://img.shields.io/cocoapods/dt/NVDate.svg)\n\n\n__NVDate__ is an extension of `NSDate` class (Swift4), created to make date and time manipulation easier. __NVDate__ is testable and robust, we wrote intensive test to make sure everything is safe.\n\nFeatures\n======\n\n* Has lot of API function to make date and time manipulation easier and fun\n* Has user friendly naming convention\n* NVDate functions are _chainable_\n* Very easy to use\n* Open Source!\n\nInstallation\n======\n\n### Using Cocoa Pods\n\n##### Swift4\n\nAdd these into your `Podfile`:\n\n```ruby\npod 'NVDate', '2.0.1'\n```\n\nThen import `NVdate` into your swift file.\n\n```swift\nimport NVDate\n```\n\n##### Objective-C\n\nAdd these into your `Podfile`:\n\n```ruby\npod 'NVDate', '1.0.0'\n```\n\nThen import `NVdate.h` into your .h or .m file.\n\n```objectivec\n#import \"NVDate.h\"\n```\n\nSimple Example\n======\n\n### Today date as string\n\n```swift\nlet date = NVDate()\n\nprint(date.asString())\n// ==\u003e Wednesday, February 5, 2014, 4:56:35 PM Western Indonesia Time\n```\n\n### Date 2018/05/25 as string\n\n```swift\nlet date = NVDate(fromString: \"2018/05/25\", withFormat: \"yyyy/MM/dd\")\n\nprint(date.asString())\n// ==\u003e Friday, May 25, 2018, 00:00:00 AM Western Indonesia Time\n```\n\n### Last day of next 2 months\n\n```swift\nlet date = NVDate()\n    .nextMonths(diff: 2)\n    .lastDayOfMonth()\n\nprint(date.asString(withFormat: \"dd-MM-yyyy\"))\n// ==\u003e 30-04-2014\n```\n\n### Second week of 2 months ago\n\n```swift\nlet date = NVDate()\n    .previousMonths(diff: 2)\n    .firstDayOfMonth()\n    .nextWeek()\ndate.dateFormat(setFormat: \"yyyy-MM-dd HH:mm:ss\")\n\nprint(date.asString())\n// ==\u003e 2013-12-08 17:03:36\n```\n\n### Detect if 2018/05/25 is friday\n\n```swift\nlet todayIsFriday = NVDate(year: 2018, month: 5, day: 25)\n    .previousDay()\n    .isTodayName(.friday)\n\nprint(todayIsFriday)\n// ==\u003e false\n```\n\n### Dot syntax\n\n```swift\nlet someday = NVDate()\n    .previousDay()\n    .previousWeek()\n    .nextDay()\n    .asString()\n\nprint(someday)\n// ==\u003e 2013-12-08 17:03:36\n```\n\nAPI Documentation\n======\n\n#### Initialization\n\nInitialization | Description\n--- | ---\n`NVDate()` | Today date is used as date value\n`NVDate(fromString:withFormat:)` | Use specified date string as date value. Format of specified date string has to be explicitly defined.\n`NVDate(year:month:day:)` | Construct new date using year, month, and day\n`NVDate(year:month:day:hour:minute:second:)` | Construct new date using year, month, day, hour, minute, second\n`NVDate(fromDate:)` | use specified date as value\n\n#### Methods\n\nMethod | Description\n--- | ---\n`date()` | return the date object\n`asString()` | return string formatted of date object\n`asString(withFormat:)` | return formatted string value of date object. the format has to be defined explicitly\n`setTimeAsZero()` | set hour, minute, and second as 0\n`dateFormat()` | return the current date format. the format is used on `asString()`\n`dateFormat(setFormat:)` | change current date format. the format is used on `asString()`\n`dateStyle()` | return the date style of current formatter\n`dateStyle(setStyle:)` | change date style of current formatter\n`timeStyle()` | return the time style of current formatter\n`timeStyle(setStyle:)` | change time style of current formatter\n`timeZone()` | return current timezone value\n`timeZone(setTimeZone:)` | change the timezone value\n`nextDays(days:)` | move to next __x__ days\n`nextDay()` | move to next day\n`tomorrow()` | alias of `nextDay()`\n`previousDays(days:)` | move to previous __x__ days\n`previousDay()` | move to previous day\n`yesterday()` | alias of `previousDay()`\n`nextWeek()` | move to next week\n`nextWeeks(diff:)` | move to next __x__ weeks\n`previousWeek()` | move to previous week\n`previousWeeks(diff:)` | move to previous __x__ weeks\n`nextMonth()` | move to next month\n`nextMonths(diff:)` | move to next __x__ months\n`previousMonth()` | move to previous month\n`previousMonths(diff:)` | move to previous __x__ months\n`nextYear()` | move to next year\n`nextYears(diff:)` | move to next __x__ years\n`previousYear()` | move to previous year\n`previousYears(diff:)` | move to previous __x__ years\n`firstDayOfMonth()` | move to first day of current month\n`lastDayOfMonth()` | move to last day of current month\n`firstMonthOfYear()` | move to first month of current year\n`lastMonthOfYear()` | move to last month of current year\n`nearestPreviousDay(_:)` | move to __x__ previous day that name equal to `NVDate.DayName`\n`nearestNextDay(_:)` | move to __x__ next day that name equal to `NVDate.DayName`\n`thisDayName()` | get today day name, in type `NVDate.DayName`\n`todayName()` | alias of `thisDayName()`\n`isThisDayName(_:)` | return true if specified day name is equal with day on the object\n`isTodayName(_:)` | alias of `isThisDayName(_:)`\n`thisMonthName()` | get this month name, in type `NVDate.MonthName`\n`isThisMonthName(_:)` | return true if specified month name is equal with month on the object\n`year()` | return year value\n`year(setYear:)` | change year value\n`month()` | return month value\n`month(setMonth:)` | change month value\n`weekOfYear()` | return week of year value\n`weekOfMonth()` | return week of month value\n`day()` | return day value\n`day(setDay:)` | change day value\n`hour()` | return hour value\n`hour(setHour:)` | change hour value\n`minute()` | return minute value\n`minute(setMinute:)` | change minute value\n`second()` | return second value\n`second(setSecond:)` | change second value\n\n\nContribution\n======\n\nFeel free to contribute by doing `fork` -\u003e `pull request`\n\n\nLicense\n======\n\nhttp://novalagung.mit-license.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovalagung%2Fnvdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovalagung%2Fnvdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovalagung%2Fnvdate/lists"}