turf-common 1.2.1-beta.50 → 1.2.1-beta.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ export declare class DateUtilService {
4
4
  getNDaysCode(n: number): string;
5
5
  getDateCode(date: Date): string;
6
6
  addNDaysToDate(date: Date, n: number): Date;
7
- convertStringToDate(dateString: string, format: string, timeZone?: string): Date;
7
+ convertStringToDate(dateString: string, format: string): Date;
8
8
  isInPast(date: Date): boolean;
9
9
  getDateFromDatabaseDate: (date: string) => Date;
10
10
  noOfDaysBetweenDates: (date1: Date, date2: Date) => number;
@@ -24,12 +24,11 @@ var DateUtilService = /** @class */ (function () {
24
24
  DateUtilService.prototype.addNDaysToDate = function (date, n) {
25
25
  return (0, date_fns_1.add)(date, { days: n });
26
26
  };
27
- DateUtilService.prototype.convertStringToDate = function (dateString, format, timeZone) {
27
+ DateUtilService.prototype.convertStringToDate = function (dateString, format) {
28
28
  var parsedDate = (0, date_fns_1.parse)(dateString, format, new Date());
29
- if (timeZone) {
30
- return utcToZonedTime(parsedDate, timeZone);
31
- }
32
- return parsedDate;
29
+ // IST has a fixed offset of UTC+5:30
30
+ var indianDate = new Date(parsedDate.getTime() + 330 * 60 * 1000);
31
+ return indianDate;
33
32
  };
34
33
  DateUtilService.prototype.isInPast = function (date) {
35
34
  return date < new Date();
@@ -114,6 +113,3 @@ var DateUtilService = /** @class */ (function () {
114
113
  }());
115
114
  exports.DateUtilService = DateUtilService;
116
115
  exports.dateUtilService = new DateUtilService();
117
- function utcToZonedTime(parsedDate, timeZone) {
118
- throw new Error("Function not implemented.");
119
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.2.1-beta.50",
3
+ "version": "1.2.1-beta.51",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",